[ python-Bugs-992017 ] code that generates a segfault on Python
2.1-2.3
SourceForge.net
noreply at sourceforge.net
Fri Jul 16 01:56:06 CEST 2004
Bugs item #992017, was opened at 2004-07-15 23:56
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=992017&group_id=5470
Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Ted Bach (bachtor)
Assigned to: Nobody/Anonymous (nobody)
Summary: code that generates a segfault on Python 2.1-2.3
Initial Comment:
On a Redhat Linux 9 based system, the following causes
a segfault:
""" In python, you can call any expression.
"""
class foo:
def __init__(s,times=1):
s.times = times
def __call__(s): print s.times
def __mul__(s,o): return foo(o)
def __coerce__(s,o):
if isinstance(o,int):
return o,s
(foo(3)*10)() # no segfault
(10*foo(3))() # segfaults
# prints 10
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=992017&group_id=5470
More information about the Python-bugs-list
mailing list