Samuele Pedroni wrote:
[...]
this should approximate that behavior better: [not tested]
import sys
....
def __new__(cls, name, bases, dic):
sub = [x for x in dic.values() if isinstance(x,HierarchMeta)]
newtype = type.__new__(cls, name, bases, dic)
for x in sub:
if not hasattr(x, '_outer_') and
getattr(sys.modules.get(x.__module__), x.__name__, None) is not x:
x._outer_ = newtype
return newtype
.....
we don't set _outer_ if a way to pickle the class is already there
This doesn't fix
class Foo:
class Bar:
pass
class Baz:
Bar = Foo.Bar
both this should be a simple fix.
Bye,
Walter Dörwald
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com