Message289448
If you try to set the __class__ of a type which doesn't support "__class__" assignments, you get the error message:
TypeError: __class__ assignment only supported for heap types or ModuleType subclasses
However, the actual restriction doesn't require a subclass of "ModuleType"; the below code works:
import random
class M(type(random)):pass
random.__class__ = M
Thus the error message is incorrect. |
|
Date |
User |
Action |
Args |
2017-03-11 16:00:21 | ppperry | set | recipients:
+ ppperry |
2017-03-11 16:00:21 | ppperry | set | messageid: <1489248021.29.0.604014111232.issue29794@psf.upfronthosting.co.za> |
2017-03-11 16:00:21 | ppperry | link | issue29794 messages |
2017-03-11 16:00:20 | ppperry | create | |
|