Should __module__ be defined as class attribute?
Ref. https://github.com/python/typeshed/blob/58f2a795bac5924367d21961af53a32af7bb5727/stdlib/builtins.pyi#L98
This results in mypyc raising an error upon code accessing obj.__class__.__module__, which I believe is the canonical way to get the attribute. See https://github.com/mypyc/mypyc/issues/1055
Note that Cython doesn't define obj.__module__, therefore it makes difficult to write portable code.
See https://github.com/python/typeshed/pull/8787 and #8789 for previous discussion
Maybe we could revisit #8789? Seems like a mypy problem that may or may not be fixed in the meantime, but should probably be fixed in any case.
Yeah I'm definitely open to revisiting either #8787 or #8789! The current stubs are incorrect, for sure.
Maybe object should just get that attribute, though I guess that only helps in the future …