Amaury Forgeot d'Arc added the comment:
Indeed. Here is another version of the script, it crashes when I set
PYTHONHASHSEED=1 and passes with PYTHONHASHSEED=3::
class Meta(type):
def __new__(meta, clsname, bases, methods):
cls = super(Meta, meta).__new__(meta, clsname, bases, methods)
count = 0
for name in vars(cls):
if name.startswith('f_'):
print('decorate', name)
count += 1
setattr(cls, name, getattr(cls, name))
assert count == 8
return cls
class Spam2(metaclass=Meta):
def f_1(self): pass
def f_2(self): pass
def f_3(self): pass
def f_4(self): pass
def f_5(self): pass
def f_6(self): pass
def f_7(self): pass
def f_8(self): pass
----------
nosy: +amaury.forgeotdarc
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue26060>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com