TypeError: cannot create weak reference to 'builtin_function_or_method' object

Kaleb Pederson kibab at icehouse.net
Sat Aug 31 12:35:04 EDT 2002


I have some code as follows:

...
print type(None) != types.StringType
...

Which results in:
TypeError: cannot create weak reference to 'builtin_function_or_method' 
object

How could my environment get mangled so that this fails?  This works under 
python 2.1.1 and under Python 2.2.0 but NOT under 2.2.1.  At this point in 
my code I'm several modules deep.  It happens in a function of a class 
instance, but not in its constructor.  I haven't been able to reproduce it 
in a test case yet.

What can I do?  Any thoughts?

--Kaleb





More information about the Python-list mailing list