On Sat, Jun 04, 2005 at 10:43:39PM +0000, John J. Lee wrote:
> 1. In derived classes, inheritance doesn't work right:

Did you expect it to print 'moo'?  I'd have been surprised, and expected
the behavior you got.

> 2. At least in 2.3 (and 2.4, AFAIK), you can't pickle classes that do
>    this.

In all the versions of Python I've used, classes are pickled by name.
This example you wrote doesn't pose any special problem when pickling.

>>> pickle.dumps(A)
'c__main__\nA\np0\n.'
>>> pickle.dumps(B)
'c__main__\nB\np0\n.'

Jeff

Attachment: pgpIxRuaKzVxS.pgp
Description: PGP signature

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to