Upgrading Class Instances Automatically on Reload

M

malv

Upgrading Class Instances Automatically on Reload:
Recipe 20.15 out of Python Cookbook #2.
Did anybody get this recipe to work?

The original example by Michael Hudson works without problems.
I'm using Python 2.4.1

malv
 
M

malv

Rene,

No, I couldn't get it to work. Sorry, I should have included that
information.

At the statement b = Bar(), the following error occurs:
The debugged program raised the exception unhandled AttributeError
"type object 'Bar' has no attribute '__instance_refs__'"

malv
 
R

Rene Pijlman

malv:
At the statement b = Bar(), the following error occurs:
The debugged program raised the exception unhandled AttributeError
"type object 'Bar' has no attribute '__instance_refs__'"

I haven't studied it at all, but the code on
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/160164 seems to
run fine with Python 2.4.2 in WingIDE on Windows XP. There's no exception
and it prints:
1
2
3

Are you perhaps using an older dead tree version of the Cookbook?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top