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
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
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)
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
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
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-
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
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
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
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
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
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
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
13 matches
Mail list logo