Message289463
Your example works because random is a module:
py> from types import ModuleType
py> import random
py> type(random) is ModuleType
True
Since random is an instance of ModuleType, your class M is a subclass of ModuleType, and assigning to random.__class__ is allowed.
I'm closing this issue, but if can demonstrate an actual problem, please feel free to re-open it. |
|
Date |
User |
Action |
Args |
2017-03-12 02:15:14 | steven.daprano | set | recipients:
+ steven.daprano, ppperry, xiang.zhang |
2017-03-12 02:15:14 | steven.daprano | set | messageid: <1489284914.01.0.476482940726.issue29794@psf.upfronthosting.co.za> |
2017-03-12 02:15:13 | steven.daprano | link | issue29794 messages |
2017-03-12 02:15:13 | steven.daprano | create | |
|