[issue1158909] unpack error in getdefaultlocale() on certain locales

2008-04-25 Thread Wummel
Wummel <[EMAIL PROTECTED]> added the comment: This bug is fixed. The fix has been checked in by Georg Brandl on 20.1.2006 here: http://svn.python.org/view/python/trunk/Lib/locale.py?rev=42100&r1=39572&r2=42100 So this bug has been fixed in Python 2.5 all along. Why did I have t

[issue2503] Replace "== None/True/False" with "is"

2008-03-29 Thread Wummel
Changes by Wummel <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file9882/0001-Replace-None-True-False-with-is.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue2503] Replace "== None/True/False" with "is"

2008-03-29 Thread Wummel
Wummel <[EMAIL PROTECTED]> added the comment: Here is an updated patch, using "is False" to be consistent, and also replacing the "!=" occurences. Added file: http://bugs.python.org/file9886/0001-Replace-None-True-False-with-is.patch

[issue2503] Replace "== None/True/False" with "is"

2008-03-28 Thread Wummel
Wummel <[EMAIL PROTECTED]> added the comment: Amaury, I never saw an object comparing equal to None. I think the most likely case is a buggy x.__eq__() implementation. Then the "if x == None" statement gets triggered, and somebody has a hard time with bug hunting. Just a note: I

[issue2502] Add enum() example for named tuples

2008-03-28 Thread Wummel
Wummel <[EMAIL PROTECTED]> added the comment: The motivation for this patch is that documenting a single function adding enum-like capabilities would hopefully eliminate the numerous "enum" recipies already out there, each handling things a

[issue2503] Replace "== None/True/False" with "is"

2008-03-28 Thread Wummel
New submission from Wummel <[EMAIL PROTECTED]>: Test equality with None/True/False singletons should be done by "is" rather than "==" to be on the safe side. Otherwise objects overriding __eq__ could compare equal to one of those singletons. -- components: Non

[issue2502] Add enum() example for named tuples

2008-03-28 Thread Wummel
New submission from Wummel <[EMAIL PROTECTED]>: Named tuples can also be used to emulate enum datatypes. The patch adds an example to the documentation. -- assignee: georg.brandl components: Documentation files: 0001-Add-enum-example-for-named-tuples.patch keywords: patch me

[issue2167] Remove unused imports

2008-02-23 Thread Wummel
New submission from Wummel: I ran the pyflakes checker over the Python source repository and removed some unused imports. Only obvious (from what I can see) unused imports were removed, with most offenders being "import os, sys, string". The diff is against current SVN (I am using git-

[issue2102] New style vs. old style classes __ror__() operator overloading

2008-02-13 Thread Wummel
Wummel added the comment: Ah yes, I did not realize the "different types" part. So it is indeed an old-style class problem, which should behave just like the new-style classes but they don't. However I would probably not fix this in the 2.x series of Python. Changing the behavi

[issue2102] New style classes __ror__() operator overloading problem

2008-02-13 Thread Wummel
New submission from Wummel: Hi, the attached code in t.py fails to run: class C (object): def __ror__ (self, other): return 42 print C() | C() $ python t.py Traceback (most recent call last): File "t.py", line 5, in ? print C() | C() TypeError: unsupported operand t

[issue1705] trace module does not annotate global statement

2007-12-28 Thread Wummel
New submission from Wummel: Hi, the trace module does not properly count the global statement. So coverage tests of functions that use the global statement always file. To reproduce write a simple function using the global statement and store it in "mytest.py" (which is attached)

[issue1159051] Handle corrupted gzip files with unexpected EOF

2007-10-25 Thread Wummel
Wummel added the comment: Here is a new test script that works with simple strings and no file objects. It reproduces the error by cutting off the last two bytes of the GZIP data. The resulting struct error is due to the read() methods missing a check that the requested amount of data is

[issue1259] string find and rfind methods give a TypeError that is misleading

2007-10-16 Thread Wummel
Wummel added the comment: I also hit this bug. The .index() methods have the same issue, as well as the methods in the string and strop modules: >>> "123".index("2", None) Traceback (most recent call last): File "", line 1, in ? TypeError: slice ind