[issue18285] In itertools.product() add argument repeat to the docstring

2013-06-22 Thread py.user
Changes by py.user : -- keywords: +patch Added file: http://bugs.python.org/file30669/issue18285.diff ___ Python tracker <http://bugs.python.org/issue18

[issue18285] In itertools.product() add argument repeat to the docstring

2013-06-22 Thread py.user
New submission from py.user: >>> import itertools >>> print(itertools.product.__doc__) product(*iterables) --> product object Cartesian product of input iterables. Equivalent to nested for-loops. ... -- assignee: docs@python components: Documentation messages: 191

[issue18285] In itertools.product() add argument repeat to the docstring

2013-06-22 Thread py.user
Changes by py.user : -- type: -> enhancement ___ Python tracker <http://bugs.python.org/issue18285> ___ ___ Python-bugs-list mailing list Unsubscri

[issue18297] In range.sample() correct the ValueError message for negative k

2013-06-24 Thread py.user
New submission from py.user: >>> random.sample('ABC', -1) Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python3.3/random.py", line 302, in sample raise ValueError("Sample larger than population

[issue18297] In range.sample() correct the ValueError message for negative k

2013-06-24 Thread py.user
Changes by py.user : -- keywords: +patch Added file: http://bugs.python.org/file30697/issue18297.diff ___ Python tracker <http://bugs.python.org/issue18

[issue18297] In random.sample() correct the ValueError message for negative k

2013-06-25 Thread py.user
py.user added the comment: it was rejected by Raymond Hettinger because the proposed message wasn't informative -- ___ Python tracker <http://bugs.python.org/is

[issue18301] In itertools.chain.from_iterable() there is no cls argument

2013-06-25 Thread py.user
New submission from py.user: http://docs.python.org/2/library/itertools.html#itertools.chain.from_iterable >>> class A: ... @classmethod ... def from_iterable(iterables): ... for it in iterables: ... for element in it: ... yield element ... >>> A.f

[issue18301] In itertools.chain.from_iterable() there is no cls argument

2013-06-25 Thread py.user
py.user added the comment: http://docs.python.org/3/library/itertools.html#itertools.chain.from_iterable -- ___ Python tracker <http://bugs.python.org/issue18

[issue18310] itertools.tee() can't accept keyword arguments

2013-06-26 Thread py.user
New submission from py.user: >>> import itertools >>> itertools.tee('x', n=2) Traceback (most recent call last): File "", line 1, in TypeError: tee() takes no keyword arguments >>> -- components: Library (Lib) messages: 191912 nosy: p

[issue18310] itertools.tee() can't accept keyword arguments

2013-06-26 Thread py.user
py.user added the comment: tee() docs describe n as a keyword -- ___ Python tracker <http://bugs.python.org/issue18310> ___ ___ Python-bugs-list mailing list Unsub

[issue18313] In itertools recipes repeatfunc() defines a non-keyword argument as keyword

2013-06-26 Thread py.user
New submission from py.user: http://docs.python.org/3/library/itertools.html#itertools-recipes "def repeatfunc(func, times=None, *args):" >>> repeatfunc(lambda x: x, times=None, 1) File "", line 1 SyntaxError: non-keyword arg after keyword arg >>> >

[issue18313] In itertools recipes repeatfunc() defines a non-keyword argument as keyword

2013-06-27 Thread py.user
Changes by py.user : -- status: open -> pending ___ Python tracker <http://bugs.python.org/issue18313> ___ ___ Python-bugs-list mailing list Unsubscri

[issue18313] In itertools recipes repeatfunc() defines a non-keyword argument as keyword

2013-06-27 Thread py.user
py.user added the comment: it should be: "def repeatfunc(func, times, *args):" and None for times described in the docstring -- status: pending -> open ___ Python tracker <http://bugs.pytho

[issue18206] license url in site.py should always use X.Y.Z form of version number

2013-07-03 Thread py.user
Changes by py.user : Added file: http://bugs.python.org/file30755/issue18206_test.diff ___ Python tracker <http://bugs.python.org/issue18206> ___ ___ Python-bugs-list m

[issue18548] In unittest doc change WidgetTestCase to SimpleWidgetTestCase in suite()

2013-07-24 Thread py.user
New submission from py.user: http://docs.python.org/3/library/unittest.html#organizing-test-code """ def suite(): suite = unittest.TestSuite() suite.addTest(WidgetTestCase('test_default_size')) suite.addTest(WidgetTestCase('test_resize')) re

[issue18566] In unittest.TestCase docs for setUp() and tearDown() don't mention AssertionError

2013-07-26 Thread py.user
New submission from py.user: http://docs.python.org/3/library/unittest.html#unittest.TestCase.setUp "any exception raised by this method will be considered an error rather than a test failure" http://docs.python.org/3/library/unittest.html#unittest.TestCase.tearDown "Any exce

[issue18573] In unittest.TestCase.assertWarns doc there is some text about assertRaises()

2013-07-27 Thread py.user
New submission from py.user: http://docs.python.org/3/library/unittest.html#unittest.TestCase.assertWarns "When used as a context manager, assertRaises() accepts" "... is to perform additional checks on the exception raised" -- assignee: docs@python components:

[issue18573] In unittest.TestCase.assertWarns doc there is some text about assertRaises()

2013-07-30 Thread py.user
py.user added the comment: What about the second line? It doesn't catch any exception utest.py #!/usr/bin/env python3 import unittest class Test(unittest.TestCase): def test_warning(self): import warnings with self.assertWarns(RuntimeWarning) as cm:

[issue18573] In unittest.TestCase.assertWarns doc there is some text about assertRaises()

2013-07-31 Thread py.user
py.user added the comment: > What second line? the second line patched in the diff file -- ___ Python tracker <http://bugs.python.org/issue18573> ___ ___ Py

[issue18663] In unittest.TestCase.assertAlmostEqual doc specify the delta description

2013-08-05 Thread py.user
New submission from py.user: http://docs.python.org/3/library/unittest.html#unittest.TestCase.assertAlmostEqual "If delta is supplied instead of places then the difference between first and second must be less (or more) than delta." -- assignee: docs@python components: Doc

[issue18313] In itertools recipes repeatfunc() defines a non-keyword argument as keyword

2013-08-08 Thread py.user
py.user added the comment: > This would require you to provide at least two elements I see how about "def repeatfunc(func, *args, times=None):" ? >>> from itertools import starmap, repeat >>> >>> def repeatfunc(func, *args, times=None): ... "&q

[issue18301] In itertools.chain.from_iterable() there is no cls argument

2013-08-08 Thread py.user
py.user added the comment: >>> import itertools >>> >>> class A(itertools.chain): ... def from_iter(arg): ... return A(iter(arg)) ... >>> class B(A): ... pass ... >>> B('a', 'b') <__main__.B object

[issue18301] In itertools.chain.from_iterable() there is no cls argument

2013-08-08 Thread py.user
py.user added the comment: changed iter(arg) to *arg >>> import itertools >>> >>> class A(itertools.chain): ... @classmethod ... def from_iter(cls, arg): ... return cls(*arg) ... >>> class B(A): ... pass ... >>> B('ab&#

[issue18696] In unittest.TestCase.longMessage doc remove a redundant sentence

2013-08-09 Thread py.user
New submission from py.user: http://docs.python.org/3/library/unittest.html#unittest.TestCase.longMessage "If set to True then any explicit failure message you pass in to the assert methods will be appended to the end of the normal failure message. The normal messages contain u

[issue18729] In unittest.TestLoader.discover doc select the name of load_tests function

2013-08-13 Thread py.user
New submission from py.user: http://docs.python.org/3/library/unittest.html#unittest.TestLoader.discover "If load_tests exists then discovery does not recurse into the package" -- assignee: docs@python components: Documentation files: issue.diff keywords: patch messages: 1

[issue18848] In unittest.TestResult .startTestRun() and .stopTestRun() methods don't work

2013-08-26 Thread py.user
New submission from py.user: http://docs.python.org/3/library/unittest.html#unittest.TestResult.startTestRun http://docs.python.org/3/library/unittest.html#unittest.TestResult.stopTestRun result.py: #!/usr/bin/env python3 import unittest class Test(unittest.TestCase): def test_1(self

[issue18894] In unittest.TestResult.failures remove deprecated fail* methods

2013-08-31 Thread py.user
New submission from py.user: http://docs.python.org/3/library/unittest.html#unittest.TestResult.failures -- assignee: docs@python components: Documentation files: issue.diff keywords: patch messages: 196644 nosy: docs@python, py.user priority: normal severity: normal status: open title

[issue18895] In unittest.TestResult.addError split the sentence

2013-08-31 Thread py.user
New submission from py.user: http://docs.python.org/3/library/unittest.html#unittest.TestResult.addError -- assignee: docs@python components: Documentation files: issue.diff keywords: patch messages: 196645 nosy: docs@python, py.user priority: normal severity: normal status: open title

[issue18951] In unittest.TestCase.assertRegex change "re" and "regex" to "r"

2013-09-06 Thread py.user
New submission from py.user: there is no direct link to table look under link http://docs.python.org/3/library/unittest.html#unittest.TestCase.assertWarnsRegex -- assignee: docs@python components: Documentation files: issue.diff keywords: patch messages: 197130 nosy: docs@python

[issue14236] re: Docstring for \s and \S doesn’t mention Unicode

2012-04-29 Thread py.user
py.user added the comment: \S is equivalent to [^\s] like \d with \D -- ___ Python tracker <http://bugs.python.org/issue14236> ___ ___ Python-bugs-list mailin

[issue14717] In generator's .close() docstring there is one argument

2012-05-03 Thread py.user
New submission from py.user : >>> g >>> print(g.close.__doc__) close(arg) -> raise GeneratorExit inside generator. >>> g.close(1) Traceback (most recent call last): File "", line 1, in TypeError: close() takes no arguments (1 given) >>

[issue14718] In the generator's try/finally statement a runtime error occurs when the generator is not exhausted

2012-05-03 Thread py.user
New submission from py.user : http://www.python.org/dev/peps/pep-0342/ " 6. Allow "yield" to be used in try/finally blocks, since garbage collection or an explicit close() call would now allow the finally clause to execute." "New syntax: yield allowed in

[issue15660] In str.format there is a misleading error message about alignment

2012-08-14 Thread py.user
New submission from py.user: >>> '{:02}'.format('a') Traceback (most recent call last): File "", line 1, in ValueError: '=' alignment not allowed in string format specifier >>> according to http://docs.python.org/py3k/libr

[issue15660] In str.format there is a misleading error message about alignment

2012-08-14 Thread py.user
py.user added the comment: found a small string in the doc about zero padding, which enables alignment equal to = -- versions: -Python 2.7, Python 3.3, Python 3.4 ___ Python tracker <http://bugs.python.org/issue15

[issue16138] In the glossary there is a small typo about __len__() in the sequence definition

2012-10-04 Thread py.user
New submission from py.user: http://docs.python.org/py3k/glossary.html#term-sequence "and defines a len() method that returns the length of the sequence" change to "and defines a __len__() special method that returns the length of the sequence" -- assignee: do

[issue18566] In unittest.TestCase docs for setUp() and tearDown() don't mention AssertionError

2014-03-15 Thread py.user
py.user added the comment: In proposed patches fix Skiptest -> :exc:`SkipTest` AssertionError -> :exc:`AssertionError` -- ___ Python tracker <http://bugs.python.org/i

[issue20985] Add new style formatting to logging.config.fileConfig

2014-03-19 Thread py.user
New submission from py.user: http://docs.python.org/3/howto/logging.html#configuring-logging " [formatter_simpleFormatter] format=%(asctime)s - %(name)s - %(levelname)s - %(message)s datefmt= " I tried to make: format={asctime} - {name} - {levelname} - {message} and it doesn'

[issue13790] In str.format an incorrect error message for list, tuple, dict, set

2014-06-12 Thread py.user
py.user added the comment: Python 2.7.7 is still printing. >>> format([], 'd') Traceback (most recent call last): File "", line 1, in ValueError: Unknown format code 'd' for object of type 'str' >>> -- _

[issue14260] re.groupindex is available for modification and continues to work, having incorrect data inside it

2012-11-13 Thread py.user
Changes by py.user : -- title: re.groupindex available for modification and continues to work, having incorrect data inside it -> re.groupindex is available for modification and continues to work, having incorrect data inside it ___ Python trac

[issue16901] In http.cookiejar.FileCookieJar() the .load() and .revert() methods don't work

2013-01-08 Thread py.user
New submission from py.user: >>> import http.cookiejar >>> cjf = http.cookiejar.FileCookieJar() >>> cjf.load('file.txt') Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.3/http/cookiejar.py&qu

[issue16715] Get rid of IOError. Use OSError instead

2013-01-08 Thread py.user
py.user added the comment: found a typo (removed LoadError) commit 80f2b1273e8c0e1a28fabe537ae9c5acbbcee187 Author: Andrew Svetlov Date: Tue Dec 25 16:47:37 2012 +0200 Replace IOError with OSError (#16715) ... diff --git a/Lib/http/cookiejar.py b/Lib/http/cookiejar.py index

[issue16715] Get rid of IOError. Use OSError instead

2013-01-10 Thread py.user
py.user added the comment: Andrew Svetlov wrote: > LoadError is inherited from OSError the comment for the function doesn't tell it today it's inherited from OSError and tomorrow it may inherit from ANYError -- ___ Python t

[issue16715] Get rid of IOError. Use OSError instead

2013-01-11 Thread py.user
py.user added the comment: Zen: Explicit is better than implicit. In the face of ambiguity, refuse the temptation to guess. I assume that someone changes the LoadError class and goes into the revert function. How he can figure out that the cookies should return to the previous state if

[issue13057] Thread not working for python 2.7.1 built with HP Compiler on HP-UX 11.31 ia64

2013-01-17 Thread py.user
py.user added the comment: found a redundant code (stdlib.h already defines the NULL macro) commit e33747a4b1a45acdd696a4e07bbd40ea7fb37366 Author: Stefan Krah Date: Thu Nov 22 22:49:11 2012 +0100 Issue #13057: Include stdio.h when NULL is used in configure.ac. --HG

[issue13057] Thread not working for python 2.7.1 built with HP Compiler on HP-UX 11.31 ia64

2013-01-17 Thread py.user
py.user added the comment: the hunk is from commit commit b2edc2629f5e0f11280ba9846d1a86346f4a7287 Author: Stefan Krah Date: Thu Nov 22 23:47:32 2012 +0100 Fix more usages of NULL without including stdio.h. --HG-- branch : 3.3

[issue17178] In all.__doc__ and any.__doc__ need to clarify the behaviour with an empty iterable like in documentation

2013-02-10 Thread py.user
New submission from py.user: >>> help(all) " all(...) all(iterable) -> bool Return True if bool(x) is True for all values x in the iterable. " >>> all([]) True >>> bool() False >>> -- assignee: docs@python components:

[issue18951] In unittest.TestCase.assertRegex change "re" and "regex" to "r"

2013-09-13 Thread py.user
py.user added the comment: ok, I will repeat patch contents in message by words to avoid guessing -- ___ Python tracker <http://bugs.python.org/issue18

[issue18206] license url in site.py should always use X.Y.Z form of version number

2013-09-13 Thread py.user
py.user added the comment: Senthil Kumaran changed the pattern from: r'^See (http://www\.python\.org/[^/]+/license.html)$' to: r'^See (http://www\.python\.org/download/releases/[^/]+/license/)$' test doesn't pass [guest@localhost cpython]$ ./python Python 3.4.0a2+

[issue18206] license url in site.py should always use X.Y.Z form of version number

2013-09-13 Thread py.user
Changes by py.user : -- status: closed -> pending ___ Python tracker <http://bugs.python.org/issue18206> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue18206] license url in site.py should always use X.Y.Z form of version number

2013-09-13 Thread py.user
py.user added the comment: R. David Murray wrote: >It is also missing the skip when the network resource is not asserted. How it connects, I copied from another python tests. The test was skipped without network connection. "support.requires('network')" ? >the 3.4.0

[issue18206] The license url in site.py should always use X.Y.Z form of version number

2013-09-13 Thread py.user
Changes by py.user : -- title: license url in site.py should always use X.Y.Z form of version number -> The license url in site.py should always use X.Y.Z form of version number ___ Python tracker <http://bugs.python.org/issu

[issue18206] The license url in site.py should always use X.Y.Z form of version number

2013-09-13 Thread py.user
py.user added the comment: The patch needs to be compatible with version 2.7 Now there urllib.request is importing only. -- ___ Python tracker <http://bugs.python.org/issue18

[issue19300] Swap keyword arguments in open() to make encoding easier to use

2013-10-19 Thread py.user
New submission from py.user: >>> print(open.__doc__) open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None) -> file object It would be handy to use open('file.txt', 'r', 'utf-8'

[issue14460] In re's positive lookbehind assertion repetition works

2014-06-26 Thread py.user
py.user added the comment: >>> m = re.search(r'(?<=(a)){10}bc', 'abc', re.DEBUG) max_repeat 10 10 assert -1 subpattern 1 literal 97 literal 98 literal 99 >>> m.group() 'bc' >>> >>> m.groups()

[issue14460] In re's positive lookbehind assertion repetition works

2014-06-26 Thread py.user
py.user added the comment: Tim Peters wrote: > (?<=a)(?<=a)(?<=a)(?<=a) There are four different points. If a1 before a2 and a2 before a3 and a3 before a4 and a4 before something. Otherwise repetition of assertion has no sense. If it has no sense, there should

[issue14460] In re's positive lookbehind assertion repetition works

2014-06-26 Thread py.user
py.user added the comment: Tim Peters wrote: > Should that raise an exception? >i += 0 >(?=a)b >(?=a)a These are another cases. The first is very special. The second and third are special too, but with different contents of assertion they can do useful work. While "(?=

[issue21977] In the re's token example OP and SKIP regexes can be improved

2014-07-14 Thread py.user
New submission from py.user: https://docs.python.org/3/library/re.html#writing-a-tokenizer There are redundant escapes in the regex: ('OP', r'[+*\/\-]'),# Arithmetic operators Sequence -+*/ is sufficient. It makes the loop to do all steps on every 4 spaces:

[issue22344] Reorganize unittest.mock docs into linear manner

2014-09-05 Thread py.user
New submission from py.user: Now, it's very inconvenient to learn this documentation. It's not compact (could be reduced in 2 or even 3 times). It repeats itself: many examples copy-pasted unchangeably. And it cites to terms that placed under those cites, so people should start at

[issue18566] In unittest.TestCase docs for setUp() and tearDown() don't mention AssertionError

2013-12-25 Thread py.user
py.user added the comment: I have built 3.4.0a4 and run - same thing -- ___ Python tracker <http://bugs.python.org/issue18566> ___ ___ Python-bugs-list mailin

[issue18310] itertools.tee() can't accept keyword arguments

2013-12-30 Thread py.user
Changes by py.user : -- status: closed -> pending ___ Python tracker <http://bugs.python.org/issue18310> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue18310] itertools.tee() can't accept keyword arguments

2013-12-30 Thread py.user
py.user added the comment: for example http://docs.python.org/3/library/itertools.html#itertools.permutations has same description and it's a keyword compare "itertools.tee(iterable, n=2)" "itertools.permutations(iterable, r=None)" >&g

[issue18310] itertools.tee() can't accept keyword arguments

2013-12-30 Thread py.user
Changes by py.user : -- status: open -> pending ___ Python tracker <http://bugs.python.org/issue18310> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue17205] In the help() function the order of methods changes

2013-02-14 Thread py.user
New submission from py.user: >>> class A: ... '''class''' ... def c(self): ... '''c doc''' ... pass ... def b(self): ... '''b doc''' ... pass ... def a(self): ... &#x

[issue16901] In http.cookiejar.FileCookieJar() the .load() and .revert() methods don't work

2013-02-27 Thread py.user
py.user added the comment: Demian Brecht wrote: >I haven't had any feedback to my proposal on python-ideas about the >removal >of LWPCookieJar and MozillaCookieJar and the introduction of >>LWPCookieProcessor and MozillaCookieProcessor yet >>(http://thread.gmane.o

[issue16901] In http.cookiejar.FileCookieJar() the .load() and .revert() methods don't work

2013-02-28 Thread py.user
py.user added the comment: Demian Brecht: >My proposal was made to python-ideas. try this http://mail.python.org/mailman/listinfo/python-dev -- ___ Python tracker <http://bugs.python.org/issu

[issue17402] In mmap doc examples map() is shadowed

2013-03-12 Thread py.user
New submission from py.user: http://docs.python.org/3/library/mmap.html examples use map as a name for the mmap object -- assignee: docs@python components: Documentation messages: 184015 nosy: docs@python, py.user priority: normal severity: normal status: open title: In mmap doc

[issue17402] In mmap doc examples map() is shadowed

2013-03-12 Thread py.user
py.user added the comment: how about "mm" ? -- ___ Python tracker <http://bugs.python.org/issue17402> ___ ___ Python-bugs-list mailing list Un

[issue17402] In mmap doc examples map() is shadowed

2013-03-12 Thread py.user
Changes by py.user : Added file: http://bugs.python.org/file29390/mm.patch ___ Python tracker <http://bugs.python.org/issue17402> ___ ___ Python-bugs-list mailin

[issue22833] The decode_header() function decodes raw part to bytes or str, depending on encoded part

2014-11-09 Thread py.user
New submission from py.user: It depends on encoded part in the header, what email.header.decode_header() returns. If the header has both raw part and encoded part, the function returns (bytes, None) for the raw part. But if the header has only raw part, the function returns (str, None) for it

[issue22833] The decode_header() function decodes raw part to bytes or str, depending on encoded part

2014-11-09 Thread py.user
Changes by py.user : -- type: -> behavior ___ Python tracker <http://bugs.python.org/issue22833> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue22833] The decode_header() function decodes raw part to bytes or str, depending on encoded part

2014-11-10 Thread py.user
py.user added the comment: R. David Murray wrote: "Is there a reason you are choosing not to use the new API?" My program is for Python 3.x. I need to decode wild headers to pretty unicode strings. Now, I do it by decode_header() and try...except for AttributeError, since a unicode

[issue23356] In argparse docs simplify example about argline

2015-01-31 Thread py.user
New submission from py.user: The example is: def convert_arg_line_to_args(self, arg_line): for arg in arg_line.split(): if not arg.strip(): continue yield arg str.split() with default delimiters never returns empty or whitespace strings in the list. >>

[issue23356] In argparse docs simplify example about argline

2015-01-31 Thread py.user
py.user added the comment: Url https://docs.python.org/3/library/argparse.html#customizing-file-parsing -- ___ Python tracker <http://bugs.python.org/issue23

[issue24338] In argparse adding wrong arguments makes malformed namespace

2015-05-31 Thread py.user
New submission from py.user: >>> import argparse >>> >>> parser = argparse.ArgumentParser() >>> _ = parser.add_argument('foo bar') >>> _ = parser.add_argument('--x --y') >>> args = parser.parse_args(['abc']) >

[issue24338] In argparse adding wrong arguments makes malformed namespace

2015-05-31 Thread py.user
py.user added the comment: Serhiy Storchaka wrote: > for example the use of such popular options as -0 or -@ Ok. What about inconsistent conversion dashes to underscores? >>> import argparse >>> >>> parser = argparse.ArgumentParser(prefix_chars='@')

[issue24338] In argparse adding wrong arguments makes malformed namespace

2015-06-03 Thread py.user
py.user added the comment: paul j3 wrote: > It's an attempt to turn such flags into valid variable names. I'm looking at code and see that he wanted to make it handy for use in a resulting Namespace. args = argparse.parse_args(['--a-b-c']) abc = args.a_b_c If he doe

[issue24419] In argparse action append_const doesn't work for positional arguments

2015-06-09 Thread py.user
New submission from py.user: Action append_const works for options: >>> import argparse >>> >>> parser = argparse.ArgumentParser() >>> _ = parser.add_argument('--foo', dest='x', action='append_const', const=42) >>>

[issue24441] In argparse add_argument() allows the empty choices argument

2015-06-12 Thread py.user
New submission from py.user: A script, configuring argparse to have no choices: #!/usr/bin/env python3 import argparse parser = argparse.ArgumentParser() parser.add_argument('foo', choices=[]) args = parser.parse_args() print(args) Running it: [guest@localhost args]$ ./t.py u

[issue24444] In argparse empty choices cannot be printed in the help

2015-06-12 Thread py.user
New submission from py.user: >>> import argparse >>> >>> parser = argparse.ArgumentParser() >>> _ = parser.add_argument('foo', choices=[], help='%(choices)s') >>> parser.print_help() Traceback (most recent call last): File "

[issue24419] In argparse action append_const doesn't work for positional arguments

2015-06-17 Thread py.user
py.user added the comment: paul j3 wrote: > What are you trying to accomplish in the examples with a 'dest'? To append all that constants to one list. >From this: Namespace(bar=[43], foo=[42]) To this: Namespace(x=[43, 42]) -- __

[issue24419] In argparse action append_const doesn't work for positional arguments

2015-06-17 Thread py.user
py.user added the comment: paul j3 wrote: > The name (and hence the 'dest') must be unique. The problem is in the dest argument of add_argument(). Why user can't set a custom name for a positional? We can use this list not only for positionals but

[issue24419] In argparse action append_const doesn't work for positional arguments

2015-06-18 Thread py.user
py.user added the comment: paul j3 wrote: > You can give the positional any custom name (the first parameter). The dest argument is not required for giving name for an optional. You can either make it automatically or set by dest, it's handy and clear. >>> import argpars

[issue24477] In argparse subparser's option goes to parent parser

2015-06-19 Thread py.user
New submission from py.user: Some misleading behaviour found with option belonging. It's possible to put one option twicely, so it can set different parameters accoding to context. A source of argt.py for test: #!/usr/bin/env python3 import argparse parser = argparse.ArgumentP

[issue24419] In argparse action append_const doesn't work for positional arguments

2015-06-22 Thread py.user
py.user added the comment: Tested on argdest.py: #!/usr/bin/env python3 import argparse parser = argparse.ArgumentParser() parser.add_argument('x', action='append') parser.add_argument('x', action='append_const', const=42, metavar='foo') par

[issue12606] Mutable Sequence Type works different for lists and bytearrays in slice[i:j:k]

2016-01-03 Thread py.user
py.user added the comment: Also memoryview() doesn't support: >>> m = memoryview(bytearray(b'abcde')) >>> m[::2] = () Traceback (most recent call last): File "", line 1, in TypeError: 'tuple' does not support the buffer interface >&

[issue15660] Clarify 0 prefix for width specifier in str.format doc,

2016-03-18 Thread py.user
py.user added the comment: There is a funny thing in 3.6.0a0 >>> '{:<09}'.format(1) '1' >>> '{:<09}'.format(10) '1' >>> '{:<09}'.format(100) '1' >>> Actually, it

[issue15660] Clarify 0 prefix for width specifier in str.format doc,

2016-03-22 Thread py.user
py.user added the comment: Terry J. Reedy (terry.reedy) wrote: > You example says to left justify '1' Nope. The fill character goes before alignment in the specification (grammatics). >>> format(1, '0<2') '10' >>> This is right. But 0

[issue14260] re.groupindex is available for modification and continues to work, having incorrect data inside it

2015-03-24 Thread py.user
py.user added the comment: @Serhiy Storchaka > What approach looks better, a copy or a read-only proxy? ISTM, your proxy patch is better, because it expects an exception rather than silence. -- ___ Python tracker <http://bugs.python.org/issu

[issue27991] In the argparse howto there is a misleading sentence about store_true

2016-09-06 Thread py.user
New submission from py.user: https://docs.python.org/3/howto/argparse.html#combining-positional-and-optional-arguments "And, just like the “store_true” action, if you don’t specify the -v flag, that flag is considered to have None value." This sentence is misleading. It sup

[issue27992] In the argparse there is a misleading words about %(prog)s value

2016-09-06 Thread py.user
New submission from py.user: https://docs.python.org/3/library/argparse.html#argumentparser-objects "prog - The name of the program (default: sys.argv[0])" It doesn't take all sys.argv[0]. It splits sys.argv[0] and takes only the trailing part. An example: a.py #!/usr/

[issue27993] In the argparse there are typos with endings in plural words

2016-09-06 Thread py.user
New submission from py.user: https://docs.python.org/3/library/argparse.html#prog "By default, ArgumentParser objects uses sys.argv[0]" Should be "objects use" as in all other places in the doc. https://docs.python.org/3/library/argparse.html#conflict-handler "B

[issue27994] In the argparse help(argparse) prints weird comments instead of good docstrings

2016-09-06 Thread py.user
New submission from py.user: >>> import argparse >>> help(argparse) >>> Output: | add_subparsers(self, **kwargs) | # == | # Optional/Positional adding methods | # == | | convert_arg_

[issue28234] In xml.etree.ElementTree docs there are many absent Element class links

2016-09-21 Thread py.user
New submission from py.user: https://docs.python.org/3/library/xml.etree.elementtree.html#reference 1. Comment 2. iselement() 3. ProcessingInstruction 4. SubElement 5. Element.find() 6. ElementTree._setroot() 7. TreeBuilder Applied a patch to the issue that adds Element class links

[issue28235] In xml.etree.ElementTree docs there is no parser argument in fromstring()

2016-09-21 Thread py.user
New submission from py.user: https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.fromstring The function has argument parser that works like in XML() function, but in the description there is no info about it (copied from XML() description). Applied a patch to

[issue28236] In xml.etree.ElementTree Element can be created with empty and None tag

2016-09-21 Thread py.user
New submission from py.user: It is possible to create and serialize an Element instance with empty string tag value: >>> import xml.etree.ElementTree as etree >>> >>> root = etree.Element('') >>> elem = etree.SubElement(root, ''

[issue28237] In xml.etree.ElementTree bytes tag or attributes raises on serialization

2016-09-21 Thread py.user
New submission from py.user: https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element "The element name, attribute names, and attribute values can be either bytestrings or Unicode strings." The element name, attribute names, and attribute value

[issue28238] In xml.etree.ElementTree findall() can't search all elements in a namespace

2016-09-21 Thread py.user
New submission from py.user: In the example there are two namespaces in one document, but it is impossible to search all elements only in one namespace: >>> import xml.etree.ElementTree as etree >>> >>> s = 'http://def"; xmlns:x="http

[issue28234] In xml.etree.ElementTree docs there are many absent Element class links

2016-09-21 Thread py.user
py.user added the comment: > I left some comments on the code review. Left an answer on a comment. (ISTM, email notification doesn't work there, I didn't get email.) -- ___ Python tracker <http://bugs.pytho

[issue28234] In xml.etree.ElementTree docs there are many absent Element class links

2016-09-22 Thread py.user
py.user added the comment: Serhiy Storchaka wrote: > I believe that in particular you can mix Python and > C implementations of Element and lxml.etree elements in one tree. The xml.etree.ElementTree.ElementTree() can accept lxml.etree.Element() as a node, but node in node is impo

[issue28234] In xml.etree.ElementTree docs there are many absent Element class links

2016-09-23 Thread py.user
py.user added the comment: Added a reply to the patch about SubElement(). (Realy email notification doesn't work in review. I left a message while publication, and it didn't come.) -- ___ Python tracker <http://bugs.python.o

<    1   2   3   >