[issue27992] Clarify %(prog)s in argparse help formatter returns basename of sys.argv[0] by default

2019-04-07 Thread py.user


Change by py.user :


--
pull_requests: +12642
stage:  -> patch review

___
Python tracker 
<https://bugs.python.org/issue27992>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27992] Clarify %(prog)s in argparse help formatter returns basename of sys.argv[0] by default

2019-04-07 Thread py.user


py.user  added the comment:

@Karthikeyan Singaravelan
Thank you for the point. I added a new patch.

--
Added file: https://bugs.python.org/file48245/argparse_sys-argv-0-basename.diff

___
Python tracker 
<https://bugs.python.org/issue27992>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2019-02-20 Thread py.user


py.user  added the comment:

@Cheryl Sabella, I guess Manjusaka has done it already and this looks fine.

--

___
Python tracker 
<https://bugs.python.org/issue28235>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 <rep...@bugs.python.org>
<http://bugs.python.org/issue28234>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 impossible.

>>> import xml.etree.ElementTree as etree_xml
>>> import lxml.etree as etree_lxml
>>> 
>>> elem1 = etree_xml.Element('a')
>>> elem2 = etree_lxml.Element('b')
>>> elem1.append(elem2)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: must be xml.etree.ElementTree.Element, not lxml.etree._Element
>>>

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28234>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-09-22 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 <rep...@bugs.python.org>
<http://bugs.python.org/issue28234>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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://x;>'
>>>
>>> root = etree.fromstring(s)
>>>
>>> root.findall('*')
[http://def}a' at 0xb73961bc>, http://x}b' at 0xb7396c34>]
>>>
>>> root.findall('{http://def}*')
[]
>>>


And same try with site package lxml works fine:

>>> import lxml.etree as etree
>>>
>>> s = 'http://def; xmlns:x="http://x;>'
>>>
>>> root = etree.fromstring(s)
>>>
>>> root.findall('*')
[http://def}a at 0xb70ab11c>, http://x}b at 0xb70ab144>]
>>>
>>> root.findall('{http://def}*')
[http://def}a at 0xb70ab11c>]
>>>

--
components: Library (Lib), XML
messages: 277130
nosy: py.user
priority: normal
severity: normal
status: open
title: In xml.etree.ElementTree findall() can't search all elements in a 
namespace
type: behavior
versions: Python 3.6

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28238>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 values can have bytes type, 
but they can't be serialized:

>>> import xml.etree.ElementTree as etree
>>>
>>> root = etree.Element(b'x')
>>> root

>>>
>>> elem = etree.SubElement(root, b'y', {b'a': b'b'})
>>> elem

>>> elem.attrib
{b'a': b'b'}
>>>
>>> etree.dump(root)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.3/xml/etree/ElementTree.py", line 1224, in dump
elem.write(sys.stdout, encoding="unicode")
  File "/usr/lib/python3.3/xml/etree/ElementTree.py", line 826, in write
qnames, namespaces = _namespaces(self._root, default_namespace)
  File "/usr/lib/python3.3/xml/etree/ElementTree.py", line 937, in _namespaces
_raise_serialization_error(tag)
  File "/usr/lib/python3.3/xml/etree/ElementTree.py", line 1105, in 
_raise_serialization_error
"cannot serialize %r (type %s)" % (text, type(text).__name__)
TypeError: cannot serialize b'x' (type bytes)
>>>
>>> etree.tostring(root)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.3/xml/etree/ElementTree.py", line 1171, in tostring
ElementTree(element).write(stream, encoding, method=method)
  File "/usr/lib/python3.3/xml/etree/ElementTree.py", line 826, in write
qnames, namespaces = _namespaces(self._root, default_namespace)
  File "/usr/lib/python3.3/xml/etree/ElementTree.py", line 937, in _namespaces
_raise_serialization_error(tag)
  File "/usr/lib/python3.3/xml/etree/ElementTree.py", line 1105, in 
_raise_serialization_error
"cannot serialize %r (type %s)" % (text, type(text).__name__)
TypeError: cannot serialize b'x' (type bytes)
>>>


Also attribute name can be serialized, but it holds the letter "b" and single 
quotes:

>>> import xml.etree.ElementTree as etree
>>> 
>>> e = etree.Element('a', {b'x': '1'})
>>> etree.tostring(e)
b''
>>>


And same try with site package lxml works fine for all cases because it 
converts bytes to unicode strings right away:

>>> import lxml.etree
>>>
>>> root = lxml.etree.Element(b'x')
>>> root

>>>
>>> elem = lxml.etree.SubElement(root, b'y', {b'a': b'b'})
>>> elem

>>>
>>> elem.attrib
{'a': 'b'}
>>>

--
components: Library (Lib), XML
messages: 277128
nosy: py.user
priority: normal
severity: normal
status: open
title: In xml.etree.ElementTree bytes tag or attributes raises on serialization
type: behavior
versions: Python 3.6

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28237>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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, '')
>>>
>>> root

>>> elem

>>>
>>> etree.tostring(root)
b'<>< />'
>>> etree.dump(root)
<>< />
>>>


It is possible to create and serialize an Element instance with None tag value:

>>> import xml.etree.ElementTree as etree
>>>
>>> root = etree.Element(None)
>>> elem = etree.SubElement(root, None)
>>>
>>> root

>>> root[0]

>>> len(root)
1
>>> etree.tostring(root)
b''
>>> etree.dump(root)

>>>


And same try with site package lxml raises an exception both for empty string 
and for None:

>>> import lxml.etree
>>>
>>> lxml.etree.Element('')
Traceback (most recent call last):
  File "", line 1, in 
  File "lxml.etree.pyx", line 2809, in lxml.etree.Element 
(src/lxml/lxml.etree.c:61393)
  File "apihelpers.pxi", line 87, in lxml.etree._makeElement 
(src/lxml/lxml.etree.c:13390)
  File "apihelpers.pxi", line 1446, in lxml.etree._getNsTag 
(src/lxml/lxml.etree.c:25978)
  File "apihelpers.pxi", line 1481, in lxml.etree.__getNsTag 
(src/lxml/lxml.etree.c:26304)
ValueError: Empty tag name
>>>
>>> lxml.etree.Element(None)
Traceback (most recent call last):
  File "", line 1, in 
  File "lxml.etree.pyx", line 2809, in lxml.etree.Element 
(src/lxml/lxml.etree.c:61393)
  File "apihelpers.pxi", line 87, in lxml.etree._makeElement 
(src/lxml/lxml.etree.c:13390)
  File "apihelpers.pxi", line 1446, in lxml.etree._getNsTag 
(src/lxml/lxml.etree.c:25978)
  File "apihelpers.pxi", line 1464, in lxml.etree.__getNsTag 
(src/lxml/lxml.etree.c:26114)
  File "apihelpers.pxi", line 1342, in lxml.etree._utf8 
(src/lxml/lxml.etree.c:24770)
TypeError: Argument must be bytes or unicode, got 'NoneType'
>>>

--
components: Library (Lib), XML
messages: 277125
nosy: py.user
priority: normal
severity: normal
status: open
title: In xml.etree.ElementTree Element can be created with empty and None tag
type: behavior
versions: Python 3.6

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28236>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 the issue that adds argument to the signature and describes 
it.

--
assignee: docs@python
components: Documentation, Library (Lib), XML
files: fromstring-parser.diff
keywords: patch
messages: 277124
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In xml.etree.ElementTree docs there is no parser argument in fromstring()
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file44776/fromstring-parser.diff

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28235>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.

--
assignee: docs@python
components: Documentation, Library (Lib), XML
files: element-link.diff
keywords: patch
messages: 277121
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In xml.etree.ElementTree docs there are many absent Element class links
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file44775/element-link.diff

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28234>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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_line_to_args(self, arg_line)
|  
|  error(self, message)
|  error(message: string)
|  
|  Prints a usage message incorporating the message to stderr and
|  exits.
|  
|  If you override this in a subclass, it should not return -- it
|  should either exit or raise an exception.
|  
|  exit(self, status=0, message=None)
|  # ===
|  # Exiting methods
|  # ===
|  
|  format_help(self)
|  
|  format_usage(self)
|  # ===
|  # Help-formatting methods
|  # ===
|  
|  parse_args(self, args=None, namespace=None)
|  # =
|  # Command line argument parsing methods
|  # =
|  
|  parse_known_args(self, args=None, namespace=None)
|  
|  print_help(self, file=None)
|  
|  print_usage(self, file=None)
|  # =
|  # Help-printing methods
|  # =
|  
|  --
|  Methods inherited from _AttributeHolder:
...


There are no docstrings for methods, hence some internal comments picked up 
instead.

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 274738
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In the argparse help(argparse) prints weird comments instead of good 
docstrings
type: behavior
versions: Python 3.6

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27994>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
"By default, ArgumentParser objects raises an exception"

Should be "objects raise" as in all other places in the doc.

Applied a patch to the issue.

--
assignee: docs@python
components: Documentation, Library (Lib)
files: argparse_objects_endings.diff
keywords: patch
messages: 274735
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In the argparse there are typos with endings in plural words
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file44421/argparse_objects_endings.diff

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27993>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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/bin/env python3

import argparse
import sys

parser = argparse.ArgumentParser()
parser.add_argument("arg", help="The name is %(prog)s, the sys.argv[0] is " + 
sys.argv[0])
args = parser.parse_args()


The output in the console:

[guest@localhost bugs]$ ../bugs/a.py -h
usage: a.py [-h] arg

positional arguments:
  arg The name is a.py and sys.argv[0] is ../bugs/a.py

optional arguments:
  -h, --help  show this help message and exit
[guest@localhost bugs]$


In the output we see that %(prog)s takes only trailing part of sys.argv[0] not 
all.

Applied a patch to the issue that specifies about part of sys.argv[0].

--
assignee: docs@python
components: Documentation, Library (Lib)
files: argparse_sys-argv-0-part.diff
keywords: patch
messages: 274729
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In the argparse there is a misleading words about %(prog)s value
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file44420/argparse_sys-argv-0-part.diff

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27992>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 supposes that "store_true" action can save None 
value. But "store_true" action always saves True or False value.

An example:

This code was taken from the argparse howto. I've just added the -f option and 
printed args to the stdout.

a.py

#!/usr/bin/env python3

import argparse

parser = argparse.ArgumentParser()
parser.add_argument("square", type=int,
help="display the square of a given number")
parser.add_argument("-v", "--verbosity", action="count",
help="increase output verbosity")
parser.add_argument("-f", "--flag", action="store_true")
args = parser.parse_args()

print('args:', args)


The output in the console:

[guest@localhost bugs]$ ./a.py 1
args: Namespace(flag=False, square=1, verbosity=None)
[guest@localhost bugs]$ 


In the output we see that the -f option have got the False value not None.

Applied a patch to the issue that just removes words about analogy with 
store_true action.

--
assignee: docs@python
components: Documentation, Library (Lib)
files: argparse_store_true.diff
keywords: patch
messages: 274725
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In the argparse howto there is a misleading sentence about store_true
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file44419/argparse_store_true.diff

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27991>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 02 - is zero padding of a number which can be done only from 
the left side.

'<02' means "justify to the left zero padded number"

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15660>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 behaves like a string, but the format should call internal format 
function of the passed number and the internal format function should not 
format different numbers as equal numbers.

Why does it represent number 1 as number 10?

>>> format(1, '<02')
'10'
>>> format(10, '')
'10'
>>>

I guess, there should be a restriction.
Zero padding for numbers should be correct.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15660>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
>>> m[::2] = b''
Traceback (most recent call last):
  File "", line 1, in 
ValueError: memoryview assignment: lvalue and rvalue have different structures
>>> m[::2] = b'123'
>>> m.tobytes()
b'1b2d3'
>>>

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12606>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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')
parser.add_argument('x', action='append_const', const=43, metavar='bar')
parser.add_argument('-x', action='append_const', const=44)

args = parser.parse_args()
print(args)


Run:

[guest@localhost debug]$ ./argdest.py -h
usage: argdest.py [-h] [-x] x

positional arguments:
  x
  foo
  bar

optional arguments:
  -h, --help  show this help message and exit
  -x
[guest@localhost debug]$ ./argdest.py -x 1 -x
Namespace(x=[44, '1', 42, 43, 44])
[guest@localhost debug]$


LGTM.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24419
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.ArgumentParser()
parser.add_argument('-f', dest='tf', action='store_true')

subs = parser.add_subparsers()

sub = subs.add_parser('cmd')
sub.add_argument('-f', dest='cf', action='store_true')

parser.add_argument('arg')

args = parser.parse_args()
print(args)


Running it:

[guest@localhost debug]$ ./argt.py cmd 1
Namespace(arg='1', cf=False, tf=False)
[guest@localhost debug]$ ./argt.py cmd -f 1
Namespace(arg='1', cf=True, tf=False)
[guest@localhost debug]$ ./argt.py cmd 1 -f
Namespace(arg='1', cf=False, tf=True)
[guest@localhost debug]$


ISTM, options for the top parser should be placed between program name and 
subcommand name in any order, and options for the subcommand should follow 
subcommand in any order. The argument of top parser should be moved to the end 
and parsed after all options were placed correctly.

--
components: Library (Lib)
messages: 245536
nosy: py.user
priority: normal
severity: normal
status: open
title: In argparse subparser's option goes to parent parser
type: behavior
versions: Python 3.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24477
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 argparse
 
 parser = argparse.ArgumentParser()
 _ = parser.add_argument('-a', '--aa')
 _ = parser.add_argument('-b', '--bb', dest='x')
 args = parser.parse_args([])
 print(args)
Namespace(aa=None, x=None)


But if you do the same thing with a positional, it throws an exception. Why?
(I'm a UNIX user and waiting predictable behaviour.)

And the situation with another action (not only append_const, but future 
extensions) shows that dest may be required.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24419
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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])

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24419
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 for optionals too.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24419
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2015-06-13 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 stdin, line 1, in module
  File /home/guest/tmp/tests/misc/git/example/cpython/main/Lib/argparse.py, 
line 2358, in print_help
self._print_message(self.format_help(), file)
  File /home/guest/tmp/tests/misc/git/example/cpython/main/Lib/argparse.py, 
line 2342, in format_help
return formatter.format_help()
  File /home/guest/tmp/tests/misc/git/example/cpython/main/Lib/argparse.py, 
line 278, in format_help
help = self._root_section.format_help()
  File /home/guest/tmp/tests/misc/git/example/cpython/main/Lib/argparse.py, 
line 208, in format_help
func(*args)
  File /home/guest/tmp/tests/misc/git/example/cpython/main/Lib/argparse.py, 
line 208, in format_help
func(*args)
  File /home/guest/tmp/tests/misc/git/example/cpython/main/Lib/argparse.py, 
line 517, in _format_action
parts.append('%*s%s\n' % (indent_first, '', help_lines[0]))
IndexError: list index out of range


It's not very useful to print empty choices, but the choices list could be 
formed dynamically. So the command-line user can't figure out what's happen.

--
components: Library (Lib)
messages: 245297
nosy: py.user
priority: normal
severity: normal
status: open
title: In argparse empty choices cannot be printed in the help
type: behavior
versions: Python 3.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
usage: t.py [-h] {}
t.py: error: too few arguments
[guest@localhost args]$ ./t.py a
usage: t.py [-h] {}
t.py: error: argument foo: invalid choice: 'a' (choose from )
[guest@localhost args]$ ./t.py 
usage: t.py [-h] {}
t.py: error: argument foo: invalid choice: '' (choose from )
[guest@localhost args]$

[guest@localhost args]$ ./t.py -h
usage: t.py [-h] {}

positional arguments:
  {}

optional arguments:
  -h, --help  show this help message and exit
[guest@localhost args]$


ISTM, it should throw an exception about empty choices rather than show help 
with empty choices.

--
components: Library (Lib)
messages: 245277
nosy: py.user
priority: normal
severity: normal
status: open
title: In argparse add_argument() allows the empty choices argument
type: behavior
versions: Python 3.3, Python 3.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24441
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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)
 _ = parser.add_argument('--bar', dest='x', action='append_const', const=43)
 parser.parse_args('--foo --bar'.split())
Namespace(x=[42, 43])


Action append_const works for single positionals:

 import argparse
 
 parser = argparse.ArgumentParser()
 _ = parser.add_argument('foo', action='append_const', const=42)
 _ = parser.add_argument('bar', action='append_const', const=43)
 parser.parse_args([])
Namespace(bar=[43], foo=[42])


Action append_const doesn't work for positionals in one list:

 import argparse
 
 parser = argparse.ArgumentParser()
 _ = parser.add_argument('foo', dest='x', action='append_const', const=42)
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/lib/python3.3/site-packages/argparse-1.1-py3.3.egg/argparse.py, 
line 1282, in add_argument

ValueError: dest supplied twice for positional argument
 _ = parser.add_argument('bar', dest='x', action='append_const', const=43)
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/lib/python3.3/site-packages/argparse-1.1-py3.3.egg/argparse.py, 
line 1282, in add_argument

ValueError: dest supplied twice for positional argument
 parser.parse_args([])
Namespace()



The reason is that a positional argument can't accept dest:

 import argparse
 
 parser = argparse.ArgumentParser()
 parser.add_argument('foo', dest='x')
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/lib/python3.3/site-packages/argparse-1.1-py3.3.egg/argparse.py, 
line 1282, in add_argument

ValueError: dest supplied twice for positional argument


--
components: Library (Lib)
messages: 245099
nosy: py.user
priority: normal
severity: normal
status: open
title: In argparse action append_const doesn't work for positional arguments
type: behavior
versions: Python 3.3, Python 3.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24419
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 doesn't convert, he cannot get attribute without getattr().

It's not a UNIX reason.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24338
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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='@')
 _ = parser.add_argument('--x-one-two-three@')
 _ = parser.add_argument('@@y-one-two-three@')
 args = parser.parse_args(['abc'])
 args
Namespace(--x-one-two-three@='abc', y_one_two_three@=None)


We set dash as non-option char, but it continues to convert to underscore while 
another option char doesn't convert.

--
status: pending - open

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24338
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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'])
 
 args
Namespace(foo bar='abc', x __y=None)
 
 'foo bar' in dir(args)
True
 'x __y' in dir(args)
True


Passing wrong arguments silently makes a namespace which attributes are not 
accessible.

ISTM, add_argument() should raise a ValueError exception.

--
components: Library (Lib)
messages: 244534
nosy: py.user
priority: normal
severity: normal
status: open
title: In argparse adding wrong arguments makes malformed namespace
type: behavior
versions: Python 3.4, Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24338
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 rep...@bugs.python.org
http://bugs.python.org/issue14260
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 rep...@bugs.python.org
http://bugs.python.org/issue23356
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.

 '  x  x  '.split()
['x', 'x']
 '  '.split()
[]


Therefore, the if condition doesn't ever continue the loop.
It can be written:

def convert_arg_line_to_args(self, arg_line):
for arg in arg_line.split():
yield arg

It's the same as:

def convert_arg_line_to_args(self, arg_line):
return iter(arg_line.split())

I guess, nothing uses next() for the result:

def convert_arg_line_to_args(self, arg_line):
return arg_line.split()

Applied a patch with the last variant.

--
assignee: docs@python
components: Documentation, Library (Lib)
files: args_ex_argline.diff
keywords: patch
messages: 235089
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In argparse docs simplify example about argline
type: performance
versions: Python 2.7, Python 3.4
Added file: http://bugs.python.org/file37934/args_ex_argline.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23356
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 string has no .decode() method.

I don't know what is new API, but I guess it's not compatible with Python 3.0.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22833
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.

 import email.header
 
 s = 'abc=?koi8-r?q?\xc1\xc2\xd7?='
 email.header.decode_header(s)
[(b'abc', None), (b'\xc1\xc2\xd7', 'koi8-r')]
 
 s = 'abc'
 email.header.decode_header(s)
[('abc', None)]


There should be (bytes, None) for both cases.

--
components: Library (Lib), email
messages: 230932
nosy: barry, py.user, r.david.murray
priority: normal
severity: normal
status: open
title: The decode_header() function decodes raw part to bytes or str, depending 
on encoded part
versions: Python 3.3, Python 3.4, Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22833
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 bugzilla-mail-...@yandex.ru:


--
type:  - behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22833
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 the bottom to anderstand what it's talking about on 
the top.

Remember Zen If the implementation is hard to explain, it's a bad idea.

- Move the MagicMock description to the point between Mock and PropertyMock 
descriptions
- Remove copy-paste examples
- Rename print to print() and StringIO to io
- Split the Autospecing section to several chunks

--
assignee: docs@python
components: Documentation
messages: 226456
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: Reorganize unittest.mock docs into linear manner
type: enhancement
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22344
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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:

('SKIP',r'[ \t]'),   # Skip over spaces and tabs

Sequence [ \t]+ is faster.


Applied patch.

--
assignee: docs@python
components: Documentation, Regular Expressions
files: re_ex_tok.diff
keywords: patch
messages: 223000
nosy: docs@python, ezio.melotti, mrabarnett, py.user
priority: normal
severity: normal
status: open
title: In the re's token example OP and SKIP regexes can be improved
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file35951/re_ex_tok.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21977
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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()
('a',)



It works like there are 10 letters a before letter b.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14460
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 be an exception.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14460
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 (?=any contents){N}a never uses the {N} part in any useful manner.


 So I think this report should be closed

I looked into Perl behaviour today, it works like Python. It's not an error 
there.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14460
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 stdin, line 1, in module
ValueError: Unknown format code 'd' for object of type 'str'


--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13790
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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't work.

In the source, I found this is not implemented.
However, new formatting has more capabilities than old.

--
components: Library (Lib)
messages: 214129
nosy: py.user
priority: normal
severity: normal
status: open
title: Add new style formatting to logging.config.fileConfig
type: enhancement
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20985
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 rep...@bugs.python.org
http://bugs.python.org/issue18566
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-12-30 Thread py.user

Changes by py.user bugzilla-mail-...@yandex.ru:


--
status: closed - pending

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18310
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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)


 itertools.permutations('abc')
itertools.permutations object at 0x7ff563b17230
 itertools.permutations('abc', r=2)
itertools.permutations object at 0x7ff563b17290
 
 
 itertools.tee('abc')
(itertools._tee object at 0x7ff563a995f0, itertools._tee object at 
0x7ff563a99638)
 itertools.tee('abc', n=2)
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: tee() takes no keyword arguments


--
status: pending - open

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18310
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-12-30 Thread py.user

Changes by py.user bugzilla-mail-...@yandex.ru:


--
status: open - pending

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18310
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 rep...@bugs.python.org
http://bugs.python.org/issue18566
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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')

instead of
open('file.txt', 'r', encoding='utf-8')

--
components: Interpreter Core
messages: 200445
nosy: py.user
priority: normal
severity: normal
status: open
title: Swap keyword arguments in open() to make encoding easier to use
type: enhancement
versions: Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19300
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 rep...@bugs.python.org
http://bugs.python.org/issue18951
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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+ (default, Sep 14 2013, 05:56:46) 
[GCC 4.7.2 20121109 (Red Hat 4.7.2-8)] on linux
Type help, copyright, credits or license for more information.
 license()
See http://www.python.org/3.4/license.html



make test
...
[265/380/3] test_site
test test_site failed -- Traceback (most recent call last):
  File /home/guest/tmp/tests/misc/git/example/cpython/Lib/test/test_site.py, 
line 416, in test_license_page
self.assertIsNotNone(mo, msg='can\'t find appropriate url in license')
AssertionError: unexpectedly None : can't find appropriate url in license
...

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18206
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 bugzilla-mail-...@yandex.ru:


--
status: closed - pending

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18206
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 license file does not yet exist on the website

http://www.python.org/download/releases/3.4.0/license/
opens

The test needs to be fixed so that it runs even when the LICENSE file exists.

The fixture can rename it back and forth.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18206
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 bugzilla-mail-...@yandex.ru:


--
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 rep...@bugs.python.org
http://bugs.python.org/issue18206
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 rep...@bugs.python.org
http://bugs.python.org/issue18206
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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, py.user
priority: normal
severity: normal
status: open
title: In unittest.TestCase.assertRegex change re and regex to r
type: enhancement
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file31636/issue.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18951
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: In unittest.TestResult.failures remove deprecated fail* methods
type: enhancement
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file31534/issue.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18894
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: In unittest.TestResult.addError split the sentence
type: enhancement
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file31535/issue.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18895
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-08-27 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):
print('test_1')

def test_2(self):
print('test_2')
self.fail('msg')

class Result(unittest.TestResult):
def startTestRun(self, test):
print('starttestrun', test)

def stopTestRun(self, test):
print('stoptestrun', test)

def startTest(self, test):
print('starttest', test)

def stopTest(self, test):
print('stoptest', test)

result = Result()
suite = unittest.defaultTestLoader.loadTestsFromTestCase(Test)
suite.run(result)

print(result)



output:

[guest@localhost result]$ ./result.py 
starttest test_1 (__main__.Test)
test_1
stoptest test_1 (__main__.Test)
starttest test_2 (__main__.Test)
test_2
stoptest test_2 (__main__.Test)
__main__.Result run=0 errors=0 failures=1
[guest@localhost result]$



I tried also print messages to a file - same thing

--
components: Library (Lib)
messages: 196266
nosy: py.user
priority: normal
severity: normal
status: open
title: In unittest.TestResult .startTestRun() and .stopTestRun() methods don't 
work
type: behavior
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18848
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: 195092
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In unittest.TestLoader.discover doc select the name of load_tests 
function
type: enhancement
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file31283/issue.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18729
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 useful information about the objects involved, for example the 
message from assertEqual shows you the repr of the two unequal objects. Setting 
this attribute to True allows you to have a custom error message in addition to 
the normal one.

the last sentence duplicates the first one

--
assignee: docs@python
components: Documentation
files: issue.diff
keywords: patch
messages: 194748
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In unittest.TestCase.longMessage doc remove a redundant sentence
type: enhancement
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file31208/issue.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18696
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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):
... Repeat calls to func with specified arguments.
... 
... Example:  repeatfunc(random.random)
... 
... if times is None:
... return starmap(func, repeat(args))
... return starmap(func, repeat(args, times))
... 
 def f(*args):
... print(args)
... 
 r = repeatfunc(f, 1, 2)
 next(r)
(1, 2)
 next(r)
(1, 2)
 next(r)
(1, 2)
 r = repeatfunc(f, 1, 2, times=1)
 next(r)
(1, 2)
 next(r)
Traceback (most recent call last):
  File stdin, line 1, in module
StopIteration


--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18313
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 at 0x7f40116d7730
 B.from_iter(['a', 'b'])
__main__.A object at 0x7f40116d7780


it should be B

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18301
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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', 'cd')
__main__.B object at 0x7fc280e93cd0
 b = B.from_iter(['ab', 'cd'])
 b
__main__.B object at 0x7fc280e93d20
 next(b)
'a'
 next(b)
'b'
 next(b)
'c'
 next(b)
'd'
 next(b)
Traceback (most recent call last):
  File stdin, line 1, in module
StopIteration


--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18301
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: Documentation
files: issue.diff
keywords: patch
messages: 194498
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In unittest.TestCase.assertAlmostEqual doc specify the delta description
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file31167/issue.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18663
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 rep...@bugs.python.org
http://bugs.python.org/issue18573
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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:
raise ValueError('f')
warnings.warn('f', RuntimeWarning)
print(repr(cm.warning))


[guest@localhost py]$ python3 -m unittest utest
E
==
ERROR: test_warning (utest.Test)
--
Traceback (most recent call last):
  File ./utest.py, line 11, in test_warning
raise ValueError('f')
ValueError: f

--
Ran 1 test in 0.000s

FAILED (errors=1)
[guest@localhost py]$


with commented raise

[guest@localhost py]$ python3 -m unittest utest
RuntimeWarning('f',)
.
--
Ran 1 test in 0.000s

OK
[guest@localhost py]$


in the patch I copied terms from the first sentence of the paragraph

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18573
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: Documentation
files: issue.diff
keywords: patch
messages: 193788
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In unittest.TestCase.assertWarns doc there is some text about 
assertRaises()
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file31054/issue.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18573
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 exception raised by this method will be considered an error rather than a 
test failure.


utest.py

#!/usr/bin/env python3

import unittest

class Test(unittest.TestCase):

def setUp(self):
raise AssertionError

def tearDown(self):
raise AssertionError

def test_nothing(self):
pass



[guest@localhost py]$ python3 -m unittest -v utest
test_nothing (utest.Test) ... FAIL

==
FAIL: test_nothing (utest.Test)
--
Traceback (most recent call last):
  File ./utest.py, line 8, in setUp
raise AssertionError
AssertionError

--
Ran 1 test in 0.000s

FAILED (failures=1)
[guest@localhost py]$


also raising unittest.SkipTest works properly

--
assignee: docs@python
components: Documentation
messages: 193772
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In unittest.TestCase docs for setUp() and tearDown() don't mention 
AssertionError
type: enhancement
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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'))
return suite


--
assignee: docs@python
components: Documentation
files: issue.diff
keywords: patch
messages: 193667
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In unittest doc change WidgetTestCase to SimpleWidgetTestCase in suite()
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file31029/issue.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18548
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 bugzilla-mail-...@yandex.ru:


Added file: http://bugs.python.org/file30755/issue18206_test.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18206
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-06-27 Thread py.user

Changes by py.user bugzilla-mail-...@yandex.ru:


--
status: open - pending

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18313
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 rep...@bugs.python.org
http://bugs.python.org/issue18313
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 stdin, line 1, in module
TypeError: tee() takes no keyword arguments


--
components: Library (Lib)
messages: 191912
nosy: py.user
priority: normal
severity: normal
status: open
title: itertools.tee() can't accept keyword arguments
type: behavior
versions: Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18310
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 rep...@bugs.python.org
http://bugs.python.org/issue18310
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 stdin, line 1
SyntaxError: non-keyword arg after keyword arg

 repeatfunc(lambda x: x, 1, times=None)
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: repeatfunc() got multiple values for argument 'times'


--
assignee: docs@python
components: Documentation
messages: 191930
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In itertools recipes repeatfunc() defines a non-keyword argument as 
keyword
type: enhancement
versions: Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18313
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 rep...@bugs.python.org
http://bugs.python.org/issue18297
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.from_iterable(['ABC', 'DEF'])
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: from_iterable() takes 1 positional argument but 2 were given


--
assignee: docs@python
components: Documentation
files: issue.diff
keywords: patch
messages: 191874
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In itertools.chain.from_iterable() there is no cls argument
type: enhancement
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file30702/issue.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18301
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 rep...@bugs.python.org
http://bugs.python.org/issue18301
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 stdin, line 1, in module
  File /usr/lib64/python3.3/random.py, line 302, in sample
raise ValueError(Sample larger than population)
ValueError: Sample larger than population


--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 191832
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In range.sample() correct the ValueError message for negative k
type: enhancement
versions: Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18297
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-06-24 Thread py.user

Changes by py.user bugzilla-mail-...@yandex.ru:


--
keywords: +patch
Added file: http://bugs.python.org/file30697/issue18297.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18297
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-06-22 Thread py.user

Changes by py.user bugzilla-mail-...@yandex.ru:


--
keywords: +patch
Added file: http://bugs.python.org/file30669/issue18285.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18285
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: 191658
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In itertools.product() add argument repeat to the docstring
versions: Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18285
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-06-22 Thread py.user

Changes by py.user bugzilla-mail-...@yandex.ru:


--
type:  - enhancement

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18285
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18220] In itertools.islice() make prototype like in help()

2013-06-21 Thread py.user

py.user added the comment:

[guest@localhost cpython]$ ./python
Python 3.4.0a0 (default, Jun 22 2013, 04:24:17) 
[GCC 4.7.2 20121109 (Red Hat 4.7.2-8)] on linux
Type help, copyright, credits or license for more information.
 
 import itertools
 print(range.__doc__, slice.__doc__, itertools.islice.__doc__, 
 sep='\n***\n') 
range(stop) - range object
range(start, stop[, step]) - range object

Returns a virtual sequence of numbers from start to stop by step.
***
slice(stop)
slice(start, stop[, step])

Create a slice object.  This is used for extended slicing (e.g. a[0:10:2]).
***
islice(iterable, [start,] stop [, step]) -- islice object

Return an iterator whose next() method returns selected values from an
iterable.  If start is specified, will skip all preceding elements;
otherwise, start defaults to zero.  Step defaults to one.  If
specified as another value, step determines how many values are 
skipped between successive calls.  Works like a slice() on a list
but returns an iterator.


I have updated the patch

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18220
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18272] In itertools recipes there is a typo in __builtins__

2013-06-20 Thread py.user

New submission from py.user:

http://docs.python.org/3/library/itertools.html#itertools-recipes
Like __builtin__.iter(func, sentinel)

--
assignee: docs@python
components: Documentation
files: issue.diff
keywords: patch
messages: 191530
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In itertools recipes there is a typo in __builtins__
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file30656/issue.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18272
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18220] In itertools.islice() make prototype like in help()

2013-06-17 Thread py.user

Changes by py.user bugzilla-mail-...@yandex.ru:


Added file: http://bugs.python.org/file30616/issue18220.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18220
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18220] In itertools.islice() make prototype like in help()

2013-06-17 Thread py.user

Changes by py.user bugzilla-mail-...@yandex.ru:


Removed file: http://bugs.python.org/file30599/issue18220.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18220
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18220] In itertools.islice() make prototype like in help()

2013-06-17 Thread py.user

py.user added the comment:

range and slice are normal in python3.4

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18220
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18239] In itertools docstring update arguments in count() example

2013-06-17 Thread py.user

New submission from py.user:

 print(itertools.__doc__)
Functional tools for creating and using iterators.

Infinite iterators:
count([n]) -- n, n+1, n+2, ...

...

--
assignee: docs@python
components: Documentation, Library (Lib)
files: issue.patch
keywords: patch
messages: 191317
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In itertools docstring update arguments in count() example
type: enhancement
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file30617/issue.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18239
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18245] In itertools.groupby() make data plural

2013-06-17 Thread py.user

New submission from py.user:

http://en.wiktionary.org/wiki/data
data (uncountable) or plural noun

--
assignee: docs@python
components: Documentation
files: issue.diff
keywords: patch
messages: 191354
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In itertools.groupby() make data plural
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file30624/issue.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18245
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18247] Add Lib/test/data/ to .gitignore

2013-06-17 Thread py.user

New submission from py.user:

have a git repository:
http://docs.python.org/devguide/faq.html#i-already-know-how-to-use-git-can-i-use-that-instead
git clone git://github.com/akheron/cpython

after running tests by make test they created some files in Lib/test/data/


[guest@localhost cpython]$ git st
# On branch master
# Changes to be committed:
#   (use git reset HEAD file... to unstage)
#
#   modified:   Doc/library/itertools.rst
#
# Changes not staged for commit:
#   (use git add file... to update what will be committed)
#   (use git checkout -- file... to discard changes in working directory)
#
#   modified:   Modules/itertoolsmodule.c
#
# Untracked files:
#   (use git add file... to include in what will be committed)
#
#   Lib/test/data/BIG5.TXT
#   Lib/test/data/BIG5HKSCS-2004.TXT
#   Lib/test/data/CP932.TXT
#   Lib/test/data/CP936.TXT
#   Lib/test/data/CP949.TXT
#   Lib/test/data/CP950.TXT
#   Lib/test/data/EUC-CN.TXT
#   Lib/test/data/EUC-JISX0213.TXT
#   Lib/test/data/EUC-JP.TXT
#   Lib/test/data/EUC-KR.TXT
#   Lib/test/data/JOHAB.TXT
#   Lib/test/data/NamedSequences.txt
#   Lib/test/data/NormalizationTest.txt
#   Lib/test/data/SHIFTJIS.TXT
#   Lib/test/data/SHIFT_JISX0213.TXT
#   Lib/test/data/gb-18030-2000.xml
[guest@localhost cpython]$

--
components: Build, Devguide
messages: 191380
nosy: ezio.melotti, py.user
priority: normal
severity: normal
status: open
title: Add Lib/test/data/ to .gitignore
type: enhancement
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18247
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18250] In itertools.repeat() object shadows object()

2013-06-17 Thread py.user

New submission from py.user:

 object
class 'object'


--
assignee: docs@python
components: Documentation
files: issue.diff
keywords: patch
messages: 191384
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In itertools.repeat() object shadows object()
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file30630/issue.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18250
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18220] In itertools.islice() make prototype like in help()

2013-06-15 Thread py.user

New submission from py.user:

http://docs.python.org/3/library/itertools.html#itertools.islice
 itertools.islice(iterable, stop)
itertools.islice(iterable, start, stop[, step])

 print(itertools.islice.__doc__)
islice(iterable, [start,] stop [, step]) -- islice object
...

--
assignee: docs@python
components: Documentation
files: issue.patch
keywords: patch
messages: 191199
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In itertools.islice() make prototype like in help()
type: enhancement
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file30599/issue.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18220
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18220] In itertools.islice() make prototype like in help()

2013-06-15 Thread py.user

py.user added the comment:

same thing with range():
http://docs.python.org/3/library/stdtypes.html?highlight=range#range
http://docs.python.org/3//library/functions.html#func-range

and with slice():
http://docs.python.org/3/library/functions.html?highlight=slice#slice
http://docs.python.org/3//library/functions.html#slice

can't patch them, because comma doesn't get into brackets
class range([start], stop[, step])

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18220
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18218] In itertools.count() clarify the starting point

2013-06-14 Thread py.user

New submission from py.user:

http://docs.python.org/3/library/itertools.html#itertools.count
itertools.count(start=0, step=1)
Make an iterator that returns evenly spaced values starting with n.

starting with start

--
assignee: docs@python
components: Documentation
files: issue.patch
keywords: patch
messages: 191196
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In itertools.count() clarify the starting point
type: enhancement
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file30596/issue.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18218
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18218] In itertools.count() clarify the starting point

2013-06-14 Thread py.user

Changes by py.user bugzilla-mail-...@yandex.ru:


Added file: http://bugs.python.org/file30597/issue18218.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18218
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18218] In itertools.count() clarify the starting point

2013-06-14 Thread py.user

Changes by py.user bugzilla-mail-...@yandex.ru:


Removed file: http://bugs.python.org/file30596/issue18218.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18218
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18206] There is no license.html on www.python.org

2013-06-13 Thread py.user

New submission from py.user:

[guest@localhost ~]$ python3
Python 3.3.0 (default, Sep 29 2012, 22:07:38)
[GCC 4.7.2 20120921 (Red Hat 4.7.2-2)] on linux
Type help, copyright, credits or license for more information.
 license()
See http://www.python.org/3.3/license.html


404


answer from webmas...@python.org:

Hello,

When I use the version of Python distributed by python.org and type license() 
I get the full license text and not the url.

It seems like this might be a change made by Red Hat? Either way, the proper 
place to discuss issues like this is on the Python bug tracker:

http://bugs.python.org/

Feel free to report an issue there and the developers can look at it.

This email address is actually for reporting problems with the Python.org 
website!

All the best,

Michael Foord



in Lib/site.py:
[guest@localhost cpython]$ sed -n '453,456p' Lib/site.py
builtins.license = _Printer(
license, See http://www.python.org/%.3s/license.html; % sys.version,
[LICENSE.txt, LICENSE],
[os.path.join(here, os.pardir), here, os.curdir])
[guest@localhost cpython]$

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 191095
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: There is no license.html on www.python.org
type: behavior
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18206
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 examples map() is shadowed
type: performance
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17402
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2013-03-12 Thread py.user

py.user added the comment:

how about mm ?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17402
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   3   >