[issue13753] str.join description contains an incorrect reference to argument
New submission from py.user : http://docs.python.org/py3k/library/stdtypes.html#str.join str.join(iterable)¶ Return a string which is the concatenation of the strings in the iterable iterable. A TypeError will be raised if there are any non-string values in seq, including bytes objects. The separator between elements is the string providing this method. "non-string values in seq" -> "non-string values in iterable" -- assignee: docs@python components: Documentation messages: 150999 nosy: docs@python, py.user priority: normal severity: normal status: open title: str.join description contains an incorrect reference to argument versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue13753> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13754] str.ljust and str.rjust do not exactly describes original string return
New submission from py.user : http://docs.python.org/py3k/library/stdtypes.html#str.ljust str.ljust(width[, fillchar])¶ Return the string left justified in a string of length width. Padding is done using the specified fillchar (default is a space). The original string is returned if width is less than len(s). str.rjust(width[, fillchar])¶ Return the string right justified in a string of length width. Padding is done using the specified fillchar (default is a space). The original string is returned if width is less than len(s). "less than len(s)" -> "less than or equal to len(s)" -- assignee: docs@python components: Documentation messages: 151000 nosy: docs@python, py.user priority: normal severity: normal status: open title: str.ljust and str.rjust do not exactly describes original string return versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue13754> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13754] str.ljust and str.rjust do not exactly describes original string return
py.user added the comment: str.zfill also -- ___ Python tracker <http://bugs.python.org/issue13754> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13755] str.endswith and str.startswith do not take lists of strings
New submission from py.user : >>> 'abcd'.endswith(['a', 'b']) Traceback (most recent call last): File "", line 1, in TypeError: Can't convert 'list' object to str implicitly >>> it would be nice like in str.join >>> ''.join(('a', 'b')) 'ab' >>> ''.join(['a', 'b']) 'ab' >>> ''.join({'a', 'b'}) 'ab' >>> ''.join({'a': 1, 'b': 2}) 'ab' >>> -- components: Interpreter Core messages: 151002 nosy: py.user priority: normal severity: normal status: open title: str.endswith and str.startswith do not take lists of strings type: behavior versions: Python 3.1 ___ Python tracker <http://bugs.python.org/issue13755> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12163] str.count
New submission from py.user : specification says [code] str.count(sub[, start[, end]]) Return the number of non-overlapping occurrences of substring sub in the range [start, end]. Optional arguments start and end are interpreted as in slice notation. [/code] [code] >>> ''.count('', None) Traceback (most recent call last): File "", line 1, in TypeError: slice indices must be integers or None or have an __index__ method >>> [/code] -- messages: 136713 nosy: py.user priority: normal severity: normal status: open title: str.count type: behavior versions: Python 2.7, Python 3.1 ___ Python tracker <http://bugs.python.org/issue12163> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12204] str.upper converts to title
New submission from py.user : specification 1) str.upper()¶ Return a copy of the string converted to uppercase. 2) str.isupper()¶ Return true if all cased characters in the string are uppercase and there is at least one cased character, false otherwise. Cased characters are those with general category property being one of “Lu”, “Ll”, or “Lt” and uppercase characters are those with general category property “Lu”. >>> '\u1ff3' 'ῳ' >>> '\u1ff3'.islower() True >>> '\u1ff3'.upper() 'ῼ' >>> '\u1ff3'.upper().isupper() False >>> -- components: None messages: 137167 nosy: py.user priority: normal severity: normal status: open title: str.upper converts to title type: behavior versions: Python 3.1 ___ Python tracker <http://bugs.python.org/issue12204> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12266] str.capitalize contradicts
New submission from py.user : specification str.capitalize()¶ Return a copy of the string with its first character capitalized and the rest lowercased. >>> '\u1ffc', '\u1ff3' ('ῼ', 'ῳ') >>> '\u1ffc'.isupper() False >>> '\u1ff3'.islower() True >>> s = '\u1ff3\u1ff3\u1ffc\u1ffc' >>> s 'ῳῳῼῼ' >>> s.capitalize() 'ῼῳῼῼ' >>> A: lower B: title A -> B & !B -> A -- components: Interpreter Core messages: 137682 nosy: py.user priority: normal severity: normal status: open title: str.capitalize contradicts versions: Python 3.1 ___ Python tracker <http://bugs.python.org/issue12266> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12266] str.capitalize contradicts
py.user added the comment: in http://bugs.python.org/issue12204 Marc-Andre Lemburg wrote: I suggest to close this ticket as invalid or to add a note to the documentation explaining how the mapping is applied (and when not). this problem is another str.capitalize makes the first character big, but it doesn't make the rest small clearing documentation is not enough lowering works >>> '\u1ffc' 'ῼ' >>> '\u1ffc'.lower() 'ῳ' >>> -- ___ Python tracker <http://bugs.python.org/issue12266> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12266] str.capitalize contradicts
Changes by py.user : -- type: -> behavior ___ Python tracker <http://bugs.python.org/issue12266> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12266] str.capitalize contradicts oneself
Changes by py.user : -- title: str.capitalize contradicts -> str.capitalize contradicts oneself ___ Python tracker <http://bugs.python.org/issue12266> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12380] bytearray center, ljust, rjust don't accept a bytearray as the fill character
New submission from py.user : >>> bytearray(b'abc').rjust(10, b'*') bytearray(b'***abc') >>> bytearray(b'abc').rjust(10, bytearray(b'*')) Traceback (most recent call last): File "", line 1, in TypeError: must be a byte string of length 1, not bytearray >>> -- components: Interpreter Core messages: 138769 nosy: py.user priority: normal severity: normal status: open title: bytearray center, ljust, rjust don't accept a bytearray as the fill character type: behavior versions: Python 2.7, Python 3.1 ___ Python tracker <http://bugs.python.org/issue12380> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12380] bytearray methods center, ljust, rjust don't accept a bytearray as the fill character
Changes by py.user : -- title: bytearray center, ljust, rjust don't accept a bytearray as the fill character -> bytearray methods center, ljust, rjust don't accept a bytearray as the fill character ___ Python tracker <http://bugs.python.org/issue12380> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12381] bytearray methods count, find, index don't support None as in slice notation
New submission from py.user : >>> bytearray(b'abc').count(bytearray(b''), None) Traceback (most recent call last): File "", line 1, in TypeError: slice indices must be integers or None or have an __index__ method >>> bytearray(b'abc').find(bytearray(b''), None) Traceback (most recent call last): File "", line 1, in TypeError: slice indices must be integers or None or have an __index__ method >>> bytearray(b'abc').index(bytearray(b''), None) Traceback (most recent call last): File "", line 1, in TypeError: slice indices must be integers or None or have an __index__ method and duplicate issues (endswith and startswith): >>> bytearray(b'abc').endswith(bytearray(b''), None) Traceback (most recent call last): File "", line 1, in TypeError: slice indices must be integers or None or have an __index__ method >>> bytearray(b'abc').startswith(bytearray(b''), None) Traceback (most recent call last): File "", line 1, in TypeError: slice indices must be integers or None or have an __index__ method >>> -- components: Interpreter Core messages: 138770 nosy: py.user priority: normal severity: normal status: open title: bytearray methods count, find, index don't support None as in slice notation type: behavior versions: Python 2.7, Python 3.1 ___ Python tracker <http://bugs.python.org/issue12381> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12380] bytearray methods center, ljust, rjust don't accept a bytearray as the fill character
py.user added the comment: all other methods support it and it's right >>> barr = bytearray(b'abcd*') >>> barr.center(len(barr) * 4, barr[-1:]) Traceback (most recent call last): File "", line 1, in TypeError: must be a byte string of length 1, not bytearray >>> b = b'abcd*' >>> b.center(len(b) * 4, b[-1:]) b'***abcd*' >>> -- ___ Python tracker <http://bugs.python.org/issue12380> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12385] the help for bytearray.maketrans describes bytes.maketrans
New submission from py.user : help(bytearray.maketrans) maketrans(...) B.maketrans(frm, to) -> translation table Return a translation table (a bytes object of length 256) suitable for use in bytes.translate where each byte in frm is mapped to the byte at the same position in to. The strings frm and to must be of the same length. -- assignee: docs@python components: Documentation messages: 138808 nosy: docs@python, py.user priority: normal severity: normal status: open title: the help for bytearray.maketrans describes bytes.maketrans versions: Python 3.1 ___ Python tracker <http://bugs.python.org/issue12385> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12380] bytearray methods center, ljust, rjust don't accept a bytearray as the fill character
py.user added the comment: > A bytearray is for working with mutable data. We don't support using > it in > all places that the non-mutable data types can be used. >>> bytearray(b'abcd').strip(bytearray(b'da')) bytearray(b'bc') >>> .translate, .find, .partition, ... >>> bytearray(b'.').join((bytearray(b'a'), bytearray(b'b'))) bytearray(b'a.b') >>> bytearray(b'.').join((b'a', b'b')) bytearray(b'a.b') >>> all these methods could use only bytes objects -- ___ Python tracker <http://bugs.python.org/issue12380> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12518] In string.Template it's impossible to transform delimiter in the derived class
New submission from py.user : >>> import string >>> class MyTemplate(string.Template): ... delimiter = '.' ... >>> MyTemplate.delimiter = 'x' >>> mt = MyTemplate('.field xfield') >>> mt.substitute(field=None) 'None xfield' >>> mt.delimiter 'x' >>> If I want to change the pattern string by any delimiter, I should create a new class for every delimiter I would change the delimiter either in the object or in the class at any time -- components: Library (Lib) messages: 140010 nosy: py.user priority: normal severity: normal status: open title: In string.Template it's impossible to transform delimiter in the derived class type: feature request versions: Python 3.1 ___ Python tracker <http://bugs.python.org/issue12518> ___ ___ Python-bugs-list mailing list Unsubscribe: http://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]
New submission from py.user : >>> barr = bytearray(b'abcde') >>> lst = list('abcde') >>> barr[::-3] = () >>> barr bytearray(b'acd') >>> lst[::-3] = () Traceback (most recent call last): File "", line 1, in ValueError: attempt to assign sequence of size 0 to extended slice of size 2 >>> del lst[::-3] >>> lst ['a', 'c', 'd'] >>> lst[::-3] = () - is more convenient way for deletion -- components: Interpreter Core messages: 140832 nosy: py.user priority: normal severity: normal status: open title: Mutable Sequence Type works different for lists and bytearrays in slice[i:j:k] type: behavior versions: Python 3.1 ___ Python tracker <http://bugs.python.org/issue12606> ___ ___ Python-bugs-list mailing list Unsubscribe: http://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]
py.user added the comment: > I happen to prefer del myself > but I agree that the two mutable sequence classes should behave the same. del is not so flexible as assignement >>> cmpr = [bytearray(i.encode('ascii')) for i in ('abcd', 'efgh', 'ijkl')] >>> cmpr [bytearray(b'abcd'), bytearray(b'efgh'), bytearray(b'ijkl')] >>> cmpr[0][::-2] = cmpr[1][::2] = cmpr[2][1::2] = () >>> cmpr [bytearray(b'ac'), bytearray(b'fh'), bytearray(b'ik')] >>> -- ___ Python tracker <http://bugs.python.org/issue12606> ___ ___ Python-bugs-list mailing list Unsubscribe: http://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]
py.user added the comment: the former could be like: del cmpr[0][::-2], cmpr[1][::2], cmpr[2][1::2] it's ok how to implement this with del ? >>> cmpr [bytearray(b'abcd'), bytearray(b'efgh'), bytearray(b'ijkl')] >>> cmpr[0][::-2], cmpr[1][::2] = (), cmpr[2][1::2] >>> cmpr [bytearray(b'ac'), bytearray(b'jflh'), bytearray(b'ijkl')] >>> -- ___ Python tracker <http://bugs.python.org/issue12606> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12266] str.capitalize contradicts oneself
py.user added the comment: >>> [c for c in all_chars if c not in L and ... L ? -- ___ Python tracker <http://bugs.python.org/issue12266> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12617] Mutable Sequence Type can work not only with iterable in slice[i:j] = t
New submission from py.user : 1) 4.6.4 Mutable Sequence Types | s[i:j] = t | slice of s from i to j is replaced | || by the contents of the iterable t | >>> lst = list('abc') >>> barr = bytearray(b'abc') >>> lst[:1] = 4 Traceback (most recent call last): File "", line 1, in TypeError: can only assign an iterable >>> barr[:1] = 4 >>> barr bytearray(b'\x00\x00\x00\x00bc') >>> there is no info about this feature in the documentation 2) 4.6.4 Mutable Sequence Types | s.extend(x) | same as s[len(s):len(s)] = x | >>> lst = list('abc') >>> barr = bytearray(b'abc') >>> lst.extend(4) Traceback (most recent call last): File "", line 1, in TypeError: 'int' object is not iterable >>> barr.extend(4) Traceback (most recent call last): File "", line 1, in TypeError: 'int' object is not iterable >>> lst[len(lst):len(lst)] = 4 Traceback (most recent call last): File "", line 1, in TypeError: can only assign an iterable >>> barr[len(barr):len(barr)] = 4 >>> barr bytearray(b'abc\x00\x00\x00\x00') >>> barr.extend(x) != barr[len(barr):len(barr)] = x -- assignee: docs@python components: Documentation, Interpreter Core messages: 140924 nosy: docs@python, py.user priority: normal severity: normal status: open title: Mutable Sequence Type can work not only with iterable in slice[i:j] = t type: behavior versions: Python 3.1 ___ Python tracker <http://bugs.python.org/issue12617> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12631] Mutable Sequence Type in .remove() is consistent only with lists, but not with bytearrays
New submission from py.user : 4.6.4 Mutable Sequence Types | s.remove(x) | same as del s[s.index(x)] | >>> b = bytearray() >>> b.extend(range(1, 6)) >>> b bytearray(b'\x01\x02\x03\x04\x05') >>> b.remove(2) >>> del b[b.index(2)] Traceback (most recent call last): File "", line 1, in TypeError: Type int doesn't support the buffer API >>> -- assignee: docs@python components: Documentation, Interpreter Core messages: 141066 nosy: docs@python, py.user priority: normal severity: normal status: open title: Mutable Sequence Type in .remove() is consistent only with lists, but not with bytearrays versions: Python 3.1 ___ Python tracker <http://bugs.python.org/issue12631> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12631] Mutable Sequence Type in .remove() is consistent only with lists, but not with bytearrays
Changes by py.user : -- type: -> behavior ___ Python tracker <http://bugs.python.org/issue12631> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12685] The backslash escape doesn't concatenate two strings in one in the with statement
New submission from py.user : >>> with open('/etc/passwd') as f1, \ ... open('/etc/profile) as f2: File "", line 2 open('/etc/profile) as f2: ^ SyntaxError: EOL while scanning string literal >>> >>> with open('/etc/passwd') as f1, open('/etc/profile') as f2: ... working example for a loop: >>> for i, j in zip(range(10), \ ... range(5, 15)): ... print(i, j) ... 0 5 1 6 2 7 3 8 4 9 5 10 6 11 7 12 8 13 9 14 >>> >>> for i, j in \ ... zip(range(10), range(5, 15)): ... print(i, j) ... 0 5 1 6 2 7 3 8 4 9 5 10 6 11 7 12 8 13 9 14 >>> -- components: Interpreter Core messages: 141596 nosy: py.user priority: normal severity: normal status: open title: The backslash escape doesn't concatenate two strings in one in the with statement type: behavior versions: Python 3.1 ___ Python tracker <http://bugs.python.org/issue12685> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12685] The backslash escape doesn't concatenate two strings in one in the with statement
py.user added the comment: yes, you're right, this is my mistake -- ___ Python tracker <http://bugs.python.org/issue12685> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8555] tkinter doesn't see _tkinter
Changes by py.user : -- resolution: invalid -> fixed ___ Python tracker <http://bugs.python.org/issue8555> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10275] how to know that a module is a module, a function is a function ?
New submission from py.user : >>> import os >>> m = os >>> type(m) >>> isinstance(m, module) Traceback (most recent call last): File "", line 1, in NameError: name 'module' is not defined >>> n = 1 >>> type(n) >>> isinstance(1, int) True >>> -- components: Interpreter Core messages: 120109 nosy: py.user priority: normal severity: normal status: open title: how to know that a module is a module, a function is a function ? type: behavior versions: Python 3.1 ___ Python tracker <http://bugs.python.org/issue10275> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8555] tkinter doesn't see _tkinter
py.user added the comment: I thought this will put the topic from unresolved to resolved Now I see this is for bugs only -- ___ Python tracker <http://bugs.python.org/issue8555> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10275] how to know that a module is a module, a function is a function ?
py.user added the comment: Ok, thanks, I thought this is some kind of a bug -- ___ Python tracker <http://bugs.python.org/issue10275> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8555] tkinter doesn't see _tkinter
New submission from py.user : [gu...@station ~]$ python3 Python 3.1.2 (r312:79147, Apr 28 2010, 11:57:19) [GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> 1+2 3 >>> import tkinter Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.1/tkinter/__init__.py", line 39, in import _tkinter # If this fails your Python may not be configured for Tk ImportError: No module named _tkinter >>> -- components: Tkinter messages: 104397 nosy: py.user priority: normal severity: normal status: open title: tkinter doesn't see _tkinter type: compile error versions: Python 3.1 ___ Python tracker <http://bugs.python.org/issue8555> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8555] tkinter doesn't see _tkinter
py.user added the comment: I have downloaded Python today (28 Apr) from the site I have a version under WinXP (it works fine), but I don't use WinXP When it told this about _tkinter, I even read the README file and compiled it with "make test", and there the same thing, it couldn't find _tkinter as for Python2.5 it's allright, but it has another Tkinter, so sources are not portable -- ___ Python tracker <http://bugs.python.org/issue8555> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8555] tkinter doesn't see _tkinter
py.user added the comment: tryed also: [r...@station python3.1]# cp /usr/lib/python2.5/lib-dynload/_tkinter.so lib-dynload answer is: Traceback (most recent call last): File "/home/guest/tmp/code/c/eclipse/pytest/src/main.py", line 4, in import tkinter File "/usr/local/lib/python3.1/tkinter/__init__.py", line 39, in import _tkinter # If this fails your Python may not be configured for Tk ImportError: /usr/local/lib/python3.1/lib-dynload/_tkinter.so: undefined symbol: _Py_ZeroStruct -- ___ Python tracker <http://bugs.python.org/issue8555> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8555] tkinter doesn't see _tkinter
py.user added the comment: ok, thank you I found that I have no tcl.h and tk.h -- ___ Python tracker <http://bugs.python.org/issue8555> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8555] tkinter doesn't see _tkinter
py.user added the comment: allright I installed two -dev packages and ran tkinter -- ___ Python tracker <http://bugs.python.org/issue8555> ___ ___ Python-bugs-list mailing list Unsubscribe: http://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
New submission from py.user : >>> '{0:d}'.format('a') Traceback (most recent call last): File "", line 1, in ValueError: Unknown format code 'd' for object of type 'str' >>> '{0:d}'.format(1+1j) Traceback (most recent call last): File "", line 1, in ValueError: Unknown format code 'd' for object of type 'complex' >>> '{0:d}'.format([]) Traceback (most recent call last): File "", line 1, in ValueError: Unknown format code 'd' for object of type 'str' >>> also strange behavior: >>> '{0:s}'.format((1, 2, 3)) '(1, 2, 3)' >>> '{0:10.5s}'.format([1, 2, 3]) '[1, 2 ' >>> -- components: Interpreter Core messages: 151277 nosy: py.user priority: normal severity: normal status: open title: In str.format an incorrect error message for list, tuple, dict, set type: behavior versions: Python 3.1 ___ Python tracker <http://bugs.python.org/issue13790> ___ ___ Python-bugs-list mailing list Unsubscribe: http://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
py.user added the comment: also strange(unobvious) behavior: >>> '{0:.3s}'.format((i for i in (1, 2, 3))) '>> '{0:.3s}'.format(range(10)) 'ran' >>> '{0:.3s}'.format(None) 'Non' >>> it would be better to print an error: ValueError: Unknown format code 's' for object of type 'generator' like in this: >>> '{0:d}'.format(4.5) Traceback (most recent call last): File "", line 1, in ValueError: Unknown format code 'd' for object of type 'float' >>> in the documentation there is nothing about it -- ___ Python tracker <http://bugs.python.org/issue13790> ___ ___ Python-bugs-list mailing list Unsubscribe: http://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
py.user added the comment: R. David Murray wrote: > it is made clear in various places that every object has an str here: http://docs.python.org/py3k/library/string.html#format-specification-mini-language 3rd paragraph: "A general convention is that an empty format string ("") produces the same result as if you had called str() on the value. A non-empty format string typically modifies the result." "an empty format string ("")" what does it mean ? "".format(value) or "{}".format(value) or "{0}".format(value) ? -- ___ Python tracker <http://bugs.python.org/issue13790> ___ ___ Python-bugs-list mailing list Unsubscribe: http://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
py.user added the comment: also here: http://docs.python.org/py3k/library/string.html#format-examples there is no example with list or tuple to know exactly how they are formatted -- ___ Python tracker <http://bugs.python.org/issue13790> ___ ___ Python-bugs-list mailing list Unsubscribe: http://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
py.user added the comment: R. David Murray wrote: > Putting nothing between the {}'s is an empty format string. this is an empty replacement field here: http://docs.python.org/py3k/library/string.html#format-string-syntax the definition of format string: "Format strings contain “replacement fields” surrounded by curly braces {}. Anything that is not contained in braces is considered literal text, which is copied unchanged to the output." "The grammar for a replacement field is as follows:" replacement_field ::= "{" [field_name] ["!" conversion] [":" format_spec] "}" -- ___ Python tracker <http://bugs.python.org/issue13790> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13811] In str.format an incorrect alignment option doesn't make fill char and onself absent
New submission from py.user : http://docs.python.org/py3k/library/string.html#format-specification-mini-language "The fill character can be any character other than ‘{‘ or ‘}’. The presence of a fill character is signaled by the character following it, which must be one of the alignment options. If the second character of format_spec is not a valid alignment option, then it is assumed that both the fill character and the alignment option are absent." >>> '{0:x>10d}'.format(1) 'x1' >>> '{0:xx10d}'.format(1) Traceback (most recent call last): File "", line 1, in ValueError: Invalid conversion specification >>> -- messages: 151505 nosy: py.user priority: normal severity: normal status: open title: In str.format an incorrect alignment option doesn't make fill char and onself absent ___ Python tracker <http://bugs.python.org/issue13811> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13811] In str.format an incorrect alignment option doesn't make fill char and onself absent
Changes by py.user : -- components: +Interpreter Core type: -> behavior versions: +Python 3.2 ___ Python tracker <http://bugs.python.org/issue13811> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13811] In str.format an incorrect alignment option doesn't make fill char and onself absent
py.user added the comment: absent fill char and align option: >>> '{0:10d}'.format(1) ' 1' >>> -- ___ Python tracker <http://bugs.python.org/issue13811> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13811] In str.format an incorrect alignment option doesn't make fill char and onself absent
py.user added the comment: Eric V. Smith wrote: > I'm not sure what you're saying here. Is it that 'xx' should be ignored? yes, the description says they are assumed absent -- ___ Python tracker <http://bugs.python.org/issue13811> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13811] In str.format an incorrect alignment option doesn't make fill char and onself absent
py.user added the comment: "If the second character of format_spec is not a valid alignment option, then it is assumed that both the fill character and the alignment option are absent." what does it mean ? -- ___ Python tracker <http://bugs.python.org/issue13811> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13811] In str.format, if invalid fill and alignment are specified, the text of the ValueError message is misleading.
py.user added the comment: Stefan Krah wrote: > Thus, if fill and align are absent, it does not mean that you can add arbitrary characters like "xx". the descriptions says in other words: "if you have used an incorrect alignment option, then the interpreter behaves like you didn't use fill and alignment" -- ___ Python tracker <http://bugs.python.org/issue13811> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13811] In str.format, if invalid fill and alignment are specified, the text of the ValueError message is misleading.
py.user added the comment: Stefan Krah wrote: > After it has been established that [[fill]align] is not present you have to > match the *whole string* with the rest of the grammar I think, there should be a text in the documentation: "if the alignment optiont is invalid, it will be raised a ValueError exception" thanx for the mailing list -- ___ Python tracker <http://bugs.python.org/issue13811> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13834] In help(bytes.strip) there is no info about leading ASCII whitespace
New submission from py.user : help(bytes.strip): strip(...) B.strip([bytes]) -> bytes Strip leading and trailing bytes contained in the argument. If the argument is omitted, strip trailing ASCII whitespace. -- assignee: docs@python components: Documentation messages: 151718 nosy: docs@python, py.user priority: normal severity: normal status: open title: In help(bytes.strip) there is no info about leading ASCII whitespace versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue13834> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13838] In str.format "{0:#.5g}" for decimal.Decimal doesn't print trailing zeros
New submission from py.user : http://docs.python.org/py3k/library/string.html#format-specification-mini-language The '#' option: "For floats, complex and Decimal the alternate form causes the result of the conversion to always contain a decimal-point character, even if no digits follow it. Normally, a decimal-point character appears in the result of these conversions only if a digit follows it. In addition, for 'g' and 'G' conversions, trailing zeros are not removed from the result." 1) >>> import decimal >>> '{0:#.5g}'.format(1.5) '1.5000' >>> '{0:.5f}'.format(decimal.Decimal(1.5)) '1.5' >>> '{0:.5g}'.format(decimal.Decimal(1.5)) '1.5' >>> '{0:#.5g}'.format(decimal.Decimal(1.5)) '1.5' >>> no zeros with "#" 2) >>> import decimal >>> '{0:#.5g}'.format(decimal.Decimal('1.5000')) '1.5000' >>> '{0:.5g}'.format(decimal.Decimal('1.5000')) '1.5000' >>> zeros without "#" -- components: Interpreter Core, Library (Lib) messages: 151790 nosy: py.user priority: normal severity: normal status: open title: In str.format "{0:#.5g}" for decimal.Decimal doesn't print trailing zeros type: behavior versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue13838> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7098] g formatting for decimal types should always strip trailing zeros.
Changes by py.user : -- nosy: +py.user ___ Python tracker <http://bugs.python.org/issue7098> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13838] In str.format "{0:#.5g}" for decimal.Decimal doesn't print trailing zeros
py.user added the comment: my question is about the "#" option it is described as working with Decimal but it doesn't work with Decimal -- ___ Python tracker <http://bugs.python.org/issue13838> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13914] In module re the repeat interval {} doesn't accept numbers greater than 65535
New submission from py.user : >>> import re >>> len(re.search(r'a+', 'a' * 10).group()) 10 >>> >>> re.search(r'a{65536,}', 'a' * 10) Traceback (most recent call last): File "/usr/local/lib/python3.2/functools.py", line 176, in wrapper result = cache[key] KeyError: (, 'a{65536,}', 0) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.2/re.py", line 158, in search return _compile(pattern, flags).search(string) File "/usr/local/lib/python3.2/re.py", line 255, in _compile return _compile_typed(type(pattern), pattern, flags) File "/usr/local/lib/python3.2/functools.py", line 180, in wrapper result = user_function(*args, **kwds) File "/usr/local/lib/python3.2/re.py", line 267, in _compile_typed return sre_compile.compile(pattern, flags) File "/usr/local/lib/python3.2/sre_compile.py", line 491, in compile p = sre_parse.parse(p, flags) File "/usr/local/lib/python3.2/sre_parse.py", line 692, in parse p = _parse_sub(source, pattern, 0) File "/usr/local/lib/python3.2/sre_parse.py", line 315, in _parse_sub itemsappend(_parse(source, state)) File "/usr/local/lib/python3.2/sre_parse.py", line 511, in _parse raise error("bad repeat interval") sre_constants.error: bad repeat interval >>> >>> >>> re.search(r'a{65536}', 'a' * 10) Traceback (most recent call last): File "/usr/local/lib/python3.2/functools.py", line 176, in wrapper result = cache[key] KeyError: (, 'a{65536}', 0) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.2/re.py", line 158, in search return _compile(pattern, flags).search(string) File "/usr/local/lib/python3.2/re.py", line 255, in _compile return _compile_typed(type(pattern), pattern, flags) File "/usr/local/lib/python3.2/functools.py", line 180, in wrapper result = user_function(*args, **kwds) File "/usr/local/lib/python3.2/re.py", line 267, in _compile_typed return sre_compile.compile(pattern, flags) File "/usr/local/lib/python3.2/sre_compile.py", line 514, in compile groupindex, indexgroup OverflowError: regular expression code size limit exceeded >>> -- components: Library (Lib), Regular Expressions messages: 152409 nosy: ezio.melotti, py.user priority: normal severity: normal status: open title: In module re the repeat interval {} doesn't accept numbers greater than 65535 type: behavior versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue13914> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14045] In regex pattern long unicode character isn't recognized by repetition characters +, * and {}
New submission from py.user : >>> import re >>> '\U0061' 'a' >>> '\U00100061' '\U00100061' >>> re.search('\U00100061', '\U00100061' * 10).group() '\U00100061' >>> re.search('\U00100061+', '\U00100061' * 10).group() '\U00100061' >>> re.search('(\U00100061)+', '\U00100061' * 10).group() '\U00100061\U00100061\U00100061\U00100061\U00100061\U00100061\U00100061\U00100061\U00100061\U00100061' >>> >>> >>> re.search('\U00100061{3}', '\U00100061' * 10) >>> re.search('(\U00100061){3}', '\U00100061' * 10).group() '\U00100061\U00100061\U00100061' >>> -- components: Library (Lib), Regular Expressions messages: 153629 nosy: ezio.melotti, py.user priority: normal severity: normal status: open title: In regex pattern long unicode character isn't recognized by repetition characters +, * and {} type: behavior versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue14045> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14069] In extensions (?...) the lookbehind assertion cannot choose between the beginning of string and a letter
New submission from py.user : >>> import re >>> re.search(r'(?<=(a|b))(\w+)', 'abc').groups() ('a', 'bc') >>> re.search(r'(?<=(^))(\w+)', 'abc').groups() ('', 'abc') >>> re.search(r'(?<=(^|$))(\w+)', 'abc').groups() ('', 'abc') >>> re.search(r'(?<=($|^))(\w+)', 'abc').groups() ('', 'abc') >>> re.search(r'(?<=(^|a))(\w+)', 'abc').groups() Traceback (most recent call last): File "/usr/local/lib/python3.2/functools.py", line 176, in wrapper result = cache[key] KeyError: (, '(?<=(^|a))(\\w+)', 0) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.2/re.py", line 158, in search return _compile(pattern, flags).search(string) File "/usr/local/lib/python3.2/re.py", line 255, in _compile return _compile_typed(type(pattern), pattern, flags) File "/usr/local/lib/python3.2/functools.py", line 180, in wrapper result = user_function(*args, **kwds) File "/usr/local/lib/python3.2/re.py", line 267, in _compile_typed return sre_compile.compile(pattern, flags) File "/usr/local/lib/python3.2/sre_compile.py", line 495, in compile code = _code(p, flags) File "/usr/local/lib/python3.2/sre_compile.py", line 480, in _code _compile(code, p.data, flags) File "/usr/local/lib/python3.2/sre_compile.py", line 115, in _compile raise error("look-behind requires fixed-width pattern") sre_constants.error: look-behind requires fixed-width pattern >>> -- components: Library (Lib), Regular Expressions messages: 153836 nosy: ezio.melotti, py.user priority: normal severity: normal status: open title: In extensions (?...) the lookbehind assertion cannot choose between the beginning of string and a letter type: behavior versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue14069> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14155] Deja vu in re's documentation
New submission from py.user : This paragraph is redundant http://docs.python.org/py3k/library/re.html#matching-vs-searching a duplicate http://docs.python.org/py3k/library/re.html#search-vs-match the part about match() behavior in multiline mode could be described in note here: http://docs.python.org/py3k/library/re.html#re.regex.match -- assignee: docs@python components: Documentation messages: 154592 nosy: docs@python, py.user priority: normal severity: normal status: open title: Deja vu in re's documentation type: enhancement versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue14155> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14155] Deja vu in re's documentation
py.user added the comment: the multiline mode affects on regex.match() >>> p = re.compile(r'^a') >>> p.match('abc\nabc') <_sre.SRE_Match object at 0xb749bf38> >>> p.match('abc\nabc').span() (0, 1) >>> p.match('abc\nabc', 4) >>> >>> p = re.compile(r'^a', re.M) >>> p.match('abc\nabc', 4) <_sre.SRE_Match object at 0xb749bf38> >>> p.match('abc\nabc', 4).span() (4, 5) >>> -- ___ Python tracker <http://bugs.python.org/issue14155> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14155] Deja vu in re's documentation
py.user added the comment: this sentence was deleted: http://docs.python.org/py3k/library/re.html#matching-vs-searching "The “match” operation succeeds only if the pattern matches at the start of the string regardless of mode, or at the starting position given by the optional pos argument regardless of whether a newline precedes it." this sentence exists now: http://docs.python.org/dev/library/re.html#re.match "Note that even in MULTILINE mode, re.match() will only match at the beginning of the string and not at the beginning of each line." but the multiline mode affects on regex.match() a reader may confuse re.match() and regex.match(), although regex.match() cites to regex.search() -- ___ Python tracker <http://bugs.python.org/issue14155> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14155] Deja vu in re's documentation
py.user added the comment: I won't open another topic: 1) http://docs.python.org/py3k/library/re.html#regular-expression-syntax "Most of the standard escapes supported by Python string literals are also accepted by the regular expression parser: \a \b \f \n \r \t \v \x \\ " \b can be used only in character set [], when others can be used without it 2) http://docs.python.org/py3k/library/re.html#regular-expression-syntax "Octal escapes are included in a limited form. If the first digit is a 0, or if there are three octal digits, it is considered an octal escape. Otherwise, it is a group reference. As for string literals, octal escapes are always at most three digits in length." http://docs.python.org/py3k/library/re.html#regular-expression-syntax description of the back refference: "\number Matches the contents of the group of the same number. Groups are numbered starting from 1. For example, (.+) \1 matches 'the the' or '55 55', but not 'the end' (note the space after the group). This special sequence can only be used to match one of the first 99 groups. If the first digit of number is 0, or number is 3 octal digits long, it will not be interpreted as a group match, but as the character with octal value number. Inside the '[' and ']' of a character class, all numeric escapes are treated as characters." a duplicate -- ___ Python tracker <http://bugs.python.org/issue14155> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14236] In help(re) are insufficient details
New submission from py.user : 1) help(re) "\s Matches any whitespace character; equivalent to [ \t\n\r\f\v]. \S Matches any non-whitespace character; equiv. to [^ \t\n\r\f\v]." no info about unicode spaces 2) help(re.split) "split(pattern, string, maxsplit=0, flags=0) Split the source string by the occurrences of the pattern, returning a list containing the resulting substrings." no info about behaviour with groups in pattern -- assignee: docs@python components: Documentation, Regular Expressions messages: 155207 nosy: docs@python, ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: In help(re) are insufficient details versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue14236> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14237] Special sequences \A and \Z don't work in character set []
New submission from py.user : >>> import re >>> re.search(r'\Ac\Z', 'c') <_sre.SRE_Match object at 0xb74cff38> >>> re.search(r'[\A]c[\Z]', 'c') >>> re.purge() >>> re.search(r'[\A]c[\Z]', 'c', re.DEBUG) in at at_beginning_string literal 99 in at at_end_string >>> -- components: Regular Expressions messages: 155208 nosy: ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: Special sequences \A and \Z don't work in character set [] type: behavior versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue14237> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14237] Special sequences \A and \Z don't work in character set []
py.user added the comment: Martin v. Löwis wrote: > What behavior would you expect? I expected similar work >>> re.search(r'[\s]a', ' a').group() ' a' >>> re.search(r'[\s]a', 'ba').group() Traceback (most recent call last): File "", line 1, in AttributeError: 'NoneType' object has no attribute 'group' >>> >>> >>> re.search(r'[^\s]a', ' a').group() Traceback (most recent call last): File "", line 1, in AttributeError: 'NoneType' object has no attribute 'group' >>> re.search(r'[^\s]a', 'ba').group() 'ba' >>> -- ___ Python tracker <http://bugs.python.org/issue14237> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14244] No information about behaviour with groups in pattern in the docstring for re.split
Changes by py.user : -- components: +Regular Expressions nosy: +ezio.melotti, mrabarnett, py.user versions: +Python 3.2 ___ Python tracker <http://bugs.python.org/issue14244> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14244] No information about behaviour with groups in pattern in the docstring for re.split
py.user added the comment: "+returning a list containing the resulting substrings. If +capturing parentheses are used in pattern, then the text of all +groups in the pattern are also returned as part of the resulting +list." not only text >>> import re >>> re.split(r'(a)(x)?', 'abcabc') ['', 'a', None, 'bc', 'a', None, 'bc'] >>> -- ___ Python tracker <http://bugs.python.org/issue14244> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14250] regex.flags is never equal to 0
New submission from py.user : http://docs.python.org/py3k/library/re.html#re.regex.flags "or 0 if no flags were provided" >>> import re >>> p = re.compile(r'', 0) >>> p.flags 32 >>> -- assignee: docs@python components: Documentation, Regular Expressions messages: 155362 nosy: docs@python, ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: regex.flags is never equal to 0 versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue14250> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14259] regex.finditer() doesn't accept keyword arguments
New submission from py.user : >>> import re >>> p = re.compile(r'abc') >>> res = p.search('abcdefabcdef', pos=1, endpos=10) >>> res = p.match('abcdefabcdef', pos=1, endpos=10) >>> res = p.findall('abcdefabcdef', pos=1, endpos=10) >>> res = p.finditer('abcdefabcdef', pos=1, endpos=10) Traceback (most recent call last): File "", line 1, in TypeError: finditer() takes no keyword arguments >>> -- components: Regular Expressions messages: 155441 nosy: ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: regex.finditer() doesn't accept keyword arguments type: behavior versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue14259> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14260] regex.groupindex available for modification and continues to work, having incorrect data inside it
New submission from py.user : >>> import re >>> p = re.compile(r'abc(?Pdef)') >>> p.sub(r'\g', 'abcdef123abcdef') 'def123def' >>> p.groupindex['n'] = 2 >>> p.sub(r'\g', 'abcdef123abcdef') 'def123def' >>> p.groupindex {'n': 2} >>> -- components: Regular Expressions messages: 155442 nosy: ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: regex.groupindex available for modification and continues to work, having incorrect data inside it type: behavior versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue14260> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14260] re.groupindex available for modification and continues to work, having incorrect data inside it
py.user added the comment: Matthew Barnett wrote: > The re module creates the dict purely for the benefit of the user this dict affects on regex.sub() >>> import re >>> p = re.compile(r'abc(?Pdef)') >>> p.groupindex {'n': 1} >>> p.groupindex['n'] = 2 >>> p.sub(r'\g', 'abcdef') Traceback (most recent call last): File "/usr/local/lib/python3.2/sre_parse.py", line 811, in expand_template literals[index] = s = g(group) IndexError: no such group During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.2/re.py", line 286, in filter return sre_parse.expand_template(template, match) File "/usr/local/lib/python3.2/sre_parse.py", line 815, in expand_template raise error("invalid group reference") sre_constants.error: invalid group reference >>> -- ___ Python tracker <http://bugs.python.org/issue14260> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14250] for string patterns regex.flags is never equal to 0
py.user added the comment: >>> import re >>> p = re.compile(br'') >>> p.flags 0 >>> -- title: regex.flags is never equal to 0 -> for string patterns regex.flags is never equal to 0 ___ Python tracker <http://bugs.python.org/issue14250> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14260] re.groupindex available for modification and continues to work, having incorrect data inside it
py.user added the comment: the first message shows how it can work with a broken dict Éric Araujo wrote: > But regex.sub is affected only if you manually muck with the dict, right? I can get code from anywhere -- ___ Python tracker <http://bugs.python.org/issue14260> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14283] match.pos describes that match object has methods search() and match()
New submission from py.user : http://docs.python.org/py3k/library/re.html#re.match.pos http://docs.python.org/py3k/library/re.html#re.match.endpos "which was passed to the search() or match() method of a match object." http://docs.python.org/py3k/library/re.html#re.match.re match object -> regular expression object -- assignee: docs@python components: Documentation, Regular Expressions messages: 155571 nosy: docs@python, ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: match.pos describes that match object has methods search() and match() versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue14283> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14260] re.groupindex available for modification and continues to work, having incorrect data inside it
py.user added the comment: I take someone's code make tests for its behavior all tests say "the code is working" I continue to write the code make tests for its behavior all tests say "the code is working" I install it somewhere and it crashes now it is depending on the cache, when this exception is raised Éric Araujo wrote: >and I don‘t think Python promises to not break when people do random editions when people do something wrong, python should raise an exception -- ___ Python tracker <http://bugs.python.org/issue14260> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14342] In re's examples the example with recursion doesn't work
New submission from py.user : http://docs.python.org/py3k/library/re.html#avoiding-recursion >>> import sys >>> sys.getrecursionlimit() 1000 >>> import re >>> s = 'Begin ' + 1000*'a very long string ' + 'end' >>> re.match('Begin (\w| )*? end', s).end() 19009 >>> -- assignee: docs@python components: Documentation, Regular Expressions messages: 156112 nosy: docs@python, ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: In re's examples the example with recursion doesn't work versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue14342> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14343] In re's examples the example with re.split() overlaps builtin input()
New submission from py.user : http://docs.python.org/py3k/library/re.html#making-a-phonebook input -> text -- assignee: docs@python components: Documentation, Regular Expressions messages: 156114 nosy: docs@python, ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: In re's examples the example with re.split() overlaps builtin input() type: enhancement versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue14343> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14460] In re's positive lookbehind assertion repetition works
New submission from py.user : >>> import re >>> re.search(r'(?<=a){100,200}bc', 'abc', re.DEBUG) max_repeat 100 200 assert -1 literal 97 literal 98 literal 99 <_sre.SRE_Match object at 0xb7429f38> >>> re.search(r'(?<=a){100,200}bc', 'abc', re.DEBUG).group() 'bc' >>> I expected "nothing to repeat" -- components: Regular Expressions messages: 157264 nosy: ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: In re's positive lookbehind assertion repetition works type: behavior versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue14460> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14461] In re's positive lookbehind assertion documentation match() cannot match
New submission from py.user : http://docs.python.org/py3k/library/re.html "Note that patterns which start with positive lookbehind assertions will never match at the beginning of the string being searched; you will most likely want to use the search() function rather than the match() function:" >>> re.match(r'(?<=^)abc', 'abc').group() 'abc' >>> re.match(r'(?<=\b)abc', 'abc').group() 'abc' >>> re.match(r'(?<=\A)abc', 'abc').group() 'abc' >>> re.match(r'(?<=\A)abc', 'abc', re.DEBUG).group() assert -1 at at_beginning_string literal 97 literal 98 literal 99 'abc' >>> in some cases match() can match -- assignee: docs@python components: Documentation, Regular Expressions messages: 157265 nosy: docs@python, ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: In re's positive lookbehind assertion documentation match() cannot match versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue14461> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14462] In re's named group the name cannot contain unicode characters
New submission from py.user : http://docs.python.org/py3k/library/re.html "(?P...) Similar to regular parentheses, but the substring matched by the group is accessible within the rest of the regular expression via the symbolic group name name. Group names must be valid Python identifiers, and each group name must be defined only once within a regular expression." >>> chr(255) 'ÿ' >>> 'ÿ'.isidentifier() True >>> import re >>> re.search(r'(?P<ÿ>a)', 'abc') Traceback (most recent call last): File "/usr/local/lib/python3.2/functools.py", line 176, in wrapper result = cache[key] KeyError: (, '(?P<ÿ>a)', 0) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.2/re.py", line 158, in search return _compile(pattern, flags).search(string) File "/usr/local/lib/python3.2/re.py", line 255, in _compile return _compile_typed(type(pattern), pattern, flags) File "/usr/local/lib/python3.2/functools.py", line 180, in wrapper result = user_function(*args, **kwds) File "/usr/local/lib/python3.2/re.py", line 267, in _compile_typed return sre_compile.compile(pattern, flags) File "/usr/local/lib/python3.2/sre_compile.py", line 491, in compile p = sre_parse.parse(p, flags) File "/usr/local/lib/python3.2/sre_parse.py", line 692, in parse p = _parse_sub(source, pattern, 0) File "/usr/local/lib/python3.2/sre_parse.py", line 315, in _parse_sub itemsappend(_parse(source, state)) File "/usr/local/lib/python3.2/sre_parse.py", line 552, in _parse raise error("bad character in group name") sre_constants.error: bad character in group name >>> also: (?P=name) (?(name)yes|no) \g -- assignee: docs@python components: Documentation, Regular Expressions messages: 157266 nosy: docs@python, ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: In re's named group the name cannot contain unicode characters type: behavior versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue14462> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8555] tkinter doesn't see _tkinter
py.user added the comment: testing new e-mail -- ___ Python tracker <http://bugs.python.org/issue8555> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14236] re: Docstring for \s and \S doesn’t mention Unicode
Changes by py.user : -- title: re: Docstring for \s and \S don’t mention Unicode -> re: Docstring for \s and \S doesn’t mention Unicode ___ Python tracker <http://bugs.python.org/issue14236> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14519] In re's examples the example with scanf() contains wrong analog for %x, %X specifiers
New submission from py.user : http://docs.python.org/py3k/library/re.html#simulating-scanf 0[xX][\dA-Fa-f]+ -> (0[xX])?[\dA-Fa-f]+ -- assignee: docs@python components: Documentation, Regular Expressions messages: 157711 nosy: docs@python, ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: In re's examples the example with scanf() contains wrong analog for %x, %X specifiers versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue14519> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14519] In re's examples the example with scanf() contains wrong analog for %x, %X specifiers
py.user added the comment: the prefix "0x" is not necessary for the %x specifier in C if the pattern will see "ABC", it will not match with it, but it should match -- ___ Python tracker <http://bugs.python.org/issue14519> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14519] In re's examples the example with scanf() contains wrong analog for %x, %X specifiers
py.user added the comment: #include int main(void) { unsigned n; scanf("%x", &n); printf("%u\n", n); return 0; } [guest@localhost c]$ .ansi t.c -o t [guest@localhost c]$ ./t 0xa 10 [guest@localhost c]$ ./t a 10 [guest@localhost c]$ [guest@localhost c]$ alias .ansi alias .ansi='gcc -ansi -pedantic -Wall' [guest@localhost c]$ -- ___ Python tracker <http://bugs.python.org/issue14519> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14519] In re's examples the example with scanf() contains wrong analog for %x, %X specifiers
py.user added the comment: the same problem in the %o analog valid strings for the %x specifier of scanf(): "+0xabc" "-0xabc" "+abc" "-abc" valid strings for the %o specifier of scanf(): "+0123" "-0123" "+123" "-123" how to patch the %x specifier: 0[xX][\dA-Fa-f]+ -> [-+]?(0[xX])?[\dA-Fa-f]+ the %o specifier: 0[0-7]*-> [-+]?[0-7]+ -- ___ Python tracker <http://bugs.python.org/issue14519> ___ ___ Python-bugs-list mailing list Unsubscribe: http://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()
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
[issue27992] Clarify %(prog)s in argparse help formatter returns basename of sys.argv[0] by default
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
[issue27992] Clarify %(prog)s in argparse help formatter returns basename of sys.argv[0] by default
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
[issue18206] There is no license.html on www.python.org
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 <http://bugs.python.org/issue18206> ___ ___ 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
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 <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
Changes by py.user : Added file: http://bugs.python.org/file30597/issue18218.patch ___ Python tracker <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
Changes by py.user : Removed file: http://bugs.python.org/file30596/issue18218.patch ___ Python tracker <http://bugs.python.org/issue18218> ___ ___ 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()
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 <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()
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 <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()
Changes by py.user : Added file: http://bugs.python.org/file30616/issue18220.patch ___ Python tracker <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()
Changes by py.user : Removed file: http://bugs.python.org/file30599/issue18220.patch ___ Python tracker <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()
py.user added the comment: range and slice are normal in python3.4 -- ___ Python tracker <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
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 <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
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 <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
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 ..." to unstage) # # modified: Doc/library/itertools.rst # # Changes not staged for commit: # (use "git add ..." to update what will be committed) # (use "git checkout -- ..." to discard changes in working directory) # # modified: Modules/itertoolsmodule.c # # Untracked files: # (use "git add ..." 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 <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()
New submission from py.user: >>> 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 <http://bugs.python.org/issue18250> ___ ___ 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__
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 <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()
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 <http://bugs.python.org/issue18220> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com