SourceForge.net | 1 Mar 05:36 2005
Picon
Picon

[ python-Bugs-1153163 ] reflected operator not used when operands have the same type

Bugs item #1153163, was opened at 2005-02-27 20:09
Message generated for change (Comment added) made by hughsw
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1153163&group_id=5470

Category: Python Interpreter Core
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Hugh Secker-Walker (hughsw)
Assigned to: Nobody/Anonymous (nobody)
Summary: reflected operator not used when operands have the same type

Initial Comment:

The reflected operators, e.g. __radd__, are used when
the left operand does not have the non-reflected
operator, *unless* the right operand is of the same type.

The documentation on the "Emulating numeric types" page
doesn't mention this peculiar exclusion.  Of the
reflected operators it says:
"These methods are called to implement the binary
arithmetic operations (+, -, *, /, %, divmod(), pow(),
**, <<, >>, &, ^, |) with reflected (swapped) operands.
These functions are only called if the left operand
does not support the corresponding operation. For
instance, to evaluate the expression x-y, where y is an
instance of a class that has an __rsub__() method,
(Continue reading)

SourceForge.net | 1 Mar 06:08 2005
Picon
Picon

[ python-Bugs-1153163 ] reflected operator not used when operands have the same type

Bugs item #1153163, was opened at 2005-02-27 20:09
Message generated for change (Comment added) made by tjreedy
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1153163&group_id=5470

Category: Python Interpreter Core
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Hugh Secker-Walker (hughsw)
Assigned to: Nobody/Anonymous (nobody)
Summary: reflected operator not used when operands have the same type

Initial Comment:

The reflected operators, e.g. __radd__, are used when
the left operand does not have the non-reflected
operator, *unless* the right operand is of the same type.

The documentation on the "Emulating numeric types" page
doesn't mention this peculiar exclusion.  Of the
reflected operators it says:
"These methods are called to implement the binary
arithmetic operations (+, -, *, /, %, divmod(), pow(),
**, <<, >>, &, ^, |) with reflected (swapped) operands.
These functions are only called if the left operand
does not support the corresponding operation. For
instance, to evaluate the expression x-y, where y is an
instance of a class that has an __rsub__() method,
(Continue reading)

SourceForge.net | 1 Mar 06:30 2005
Picon
Picon

[ python-Bugs-1153622 ] eval does not bind variables in lambda bodies correctly

Bugs item #1153622, was opened at 2005-02-28 11:48
Message generated for change (Comment added) made by tjreedy
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1153622&group_id=5470

Category: Parser/Compiler
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Mattias EngdegÄrd (yorick)
Assigned to: Nobody/Anonymous (nobody)
Summary: eval does not bind variables in lambda bodies correctly

Initial Comment:
eval() does not bind variables in lambda expressions
correctly:

>>>def f(g): return eval('lambda x: g(x)')
>>>f(lambda y: y * 2)(17)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "<string>", line 1, in <lambda>
NameError: global name 'g' is not defined

The docs say this about eval():

# If both dictionaries are omitted, the expression is
# executed in the environment where eval is called.

(Continue reading)

SourceForge.net | 1 Mar 07:36 2005
Picon
Picon

[ python-Bugs-1153226 ] string interpolation breaks with %d and large float

Bugs item #1153226, was opened at 2005-02-27 21:10
Message generated for change (Comment added) made by josiahcarlson
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1153226&group_id=5470

Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Stephen Thorne (jerub)
Assigned to: Nobody/Anonymous (nobody)
Summary: string interpolation breaks with %d and large float

Initial Comment:
We have experienced a problem recently when wanting to
render a large float as a string. Converting the float
to an int/long manuall was required. 

'%d' % f
throws an exception for all floats f, f >= 2**31

Expected output, shown with 'int()' and 'long()':
>>> '%d %d' % (long(float(2**31)), int(float(2**31)))
'2147483648 2147483648'

Non-Working Example.
>>> '%d' % float(2**31)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
(Continue reading)

SourceForge.net | 1 Mar 09:40 2005
Picon
Picon

[ python-Bugs-1149804 ] macostools.mkdirs: not thread-safe

Bugs item #1149804, was opened at 2005-02-23 14:26
Message generated for change (Comment added) made by jvr
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1149804&group_id=5470

Category: Macintosh
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jurjen N.E. Bos (jneb)
Assigned to: Jack Jansen (jackjansen)
Summary: macostools.mkdirs: not thread-safe

Initial Comment:
Here is an easily fixable semi-bug in macostools:
When two threads are creating the same directory structure, one 
of them will fail as soon as the other thread made a directory.
This is trivially fixable by ignoring the error, but I'm not sure if it is 
worth it, like this:

def mkdirs(dst):
    """Make directories leading to 'dst' if they don't exist yet"""
    if dst == '' or os.path.exists(dst):
        return
    head, tail = os.path.split(dst)
    if os.sep == ':' and not ':' in head:
        head = head + ':'
    mkdirs(head)
    try: os.mkdir(dst, 0777)
(Continue reading)

SourceForge.net | 1 Mar 09:49 2005
Picon
Picon

[ python-Bugs-1149804 ] macostools.mkdirs: not thread-safe

Bugs item #1149804, was opened at 2005-02-23 14:26
Message generated for change (Comment added) made by jvr
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1149804&group_id=5470

Category: Macintosh
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jurjen N.E. Bos (jneb)
Assigned to: Jack Jansen (jackjansen)
Summary: macostools.mkdirs: not thread-safe

Initial Comment:
Here is an easily fixable semi-bug in macostools:
When two threads are creating the same directory structure, one 
of them will fail as soon as the other thread made a directory.
This is trivially fixable by ignoring the error, but I'm not sure if it is 
worth it, like this:

def mkdirs(dst):
    """Make directories leading to 'dst' if they don't exist yet"""
    if dst == '' or os.path.exists(dst):
        return
    head, tail = os.path.split(dst)
    if os.sep == ':' and not ':' in head:
        head = head + ':'
    mkdirs(head)
    try: os.mkdir(dst, 0777)
(Continue reading)

SourceForge.net | 1 Mar 10:11 2005
Picon
Picon

[ python-Bugs-1153622 ] eval does not bind variables in lambda bodies correctly

Bugs item #1153622, was opened at 2005-02-28 17:48
Message generated for change (Comment added) made by yorick
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1153622&group_id=5470

Category: Parser/Compiler
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Mattias EngdegÄrd (yorick)
Assigned to: Nobody/Anonymous (nobody)
Summary: eval does not bind variables in lambda bodies correctly

Initial Comment:
eval() does not bind variables in lambda expressions
correctly:

>>>def f(g): return eval('lambda x: g(x)')
>>>f(lambda y: y * 2)(17)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "<string>", line 1, in <lambda>
NameError: global name 'g' is not defined

The docs say this about eval():

# If both dictionaries are omitted, the expression is
# executed in the environment where eval is called.

(Continue reading)

SourceForge.net | 1 Mar 12:59 2005
Picon
Picon

[ python-Bugs-1120452 ] Python 2.4.0 crashes with a segfault, EXAMPLE ATTACHED

Bugs item #1120452, was opened at 2005-02-11 01:04
Message generated for change (Comment added) made by amauryf
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1120452&group_id=5470

Category: Regular Expressions
Group: Python 2.4
Status: Open
Resolution: None
Priority: 7
Submitted By: Viktor Ferenczi (complex)
Assigned to: Nobody/Anonymous (nobody)
Summary: Python 2.4.0 crashes with a segfault, EXAMPLE ATTACHED

Initial Comment:
Running the attached example crashes python 2.4.0 on linux (segfault) and Windows. Python is compiled on
Debian Linux 3.0r3 (Woody). On Windows XP, I used the MSI installer downloaded from python.org

This may be a problem with the regular expression module, but I'm not sure. Please assign a new category if it
appears as a regexp bug.

This bug causes permanent crashes in my new WEB applications. Old apps not using regexp and PyMeld seem to
run correctly.

Thanks for 2.4.1.

----------------------------------------------------------------------

Comment By: Amaury Forgeot d'Arc (amauryf)
Date: 2005-03-01 12:59
(Continue reading)

SourceForge.net | 1 Mar 14:21 2005
Picon
Picon

[ python-Bugs-1153226 ] string interpolation breaks with %d and large float

Bugs item #1153226, was opened at 2005-02-28 15:10
Message generated for change (Comment added) made by jerub
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1153226&group_id=5470

Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Stephen Thorne (jerub)
Assigned to: Nobody/Anonymous (nobody)
Summary: string interpolation breaks with %d and large float

Initial Comment:
We have experienced a problem recently when wanting to
render a large float as a string. Converting the float
to an int/long manuall was required. 

'%d' % f
throws an exception for all floats f, f >= 2**31

Expected output, shown with 'int()' and 'long()':
>>> '%d %d' % (long(float(2**31)), int(float(2**31)))
'2147483648 2147483648'

Non-Working Example.
>>> '%d' % float(2**31)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
(Continue reading)

SourceForge.net | 1 Mar 16:38 2005
Picon
Picon

[ python-Bugs-1153226 ] string interpolation breaks with %d and large float

Bugs item #1153226, was opened at 2005-02-27 23:10
Message generated for change (Comment added) made by montanaro
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1153226&group_id=5470

Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Stephen Thorne (jerub)
Assigned to: Nobody/Anonymous (nobody)
Summary: string interpolation breaks with %d and large float

Initial Comment:
We have experienced a problem recently when wanting to
render a large float as a string. Converting the float
to an int/long manuall was required. 

'%d' % f
throws an exception for all floats f, f >= 2**31

Expected output, shown with 'int()' and 'long()':
>>> '%d %d' % (long(float(2**31)), int(float(2**31)))
'2147483648 2147483648'

Non-Working Example.
>>> '%d' % float(2**31)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
(Continue reading)


Gmane