[issue11604] Have type(n,b,d) check for type(b[i]) is module

2020-11-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: I cannot anymore remember seeing this. So closing. -- resolution: -> out of date stage: test needed -> resolved status: pending -> closed ___ Python tracker

[issue11604] Have type(n,b,d) check for type(b[i]) is module

2020-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Special cases aren't special enough to break the rules. I think this issue should be closed. This is not common user error, especially in Python 3. I can even imagine that you can subclass module, if it is an instance of special ModuleType subclass. It is

[issue11604] Have type(n,b,d) check for type(b[i]) is module

2020-11-16 Thread Irit Katriel
Change by Irit Katriel : -- keywords: +newcomer friendly versions: +Python 3.10, Python 3.9 -Python 3.3 ___ Python tracker ___ ___

[issue11604] Have type(n,b,d) check for type(b[i]) is module

2011-07-13 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: I don’t know if this should be left to lint tools or addressed by CPython itself. Raymond, do you have an opinion? -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org

[issue11604] Have type(n,b,d) check for type(b[i]) is module

2011-03-20 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: raise TypeError('Cannot subclass module') It is possible to subclass module. Ray: right, but 2.x still has a long life ahead of it, so we still want to improve its doc. -- nosy: +eric.araujo ___

[issue11604] Have type(n,b,d) check for type(b[i]) is module

2011-03-20 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: Whoops. That should be 'Cannot subclass a module' or 'Cannot subclass module %s' % modulename. Types.ModuleType can indeed by subclassed. I agree that this is not a pressing issue, but it will at least provide an answer to anyone searching

[issue11604] Have type(n,b,d) check for type(b[i]) is module

2011-03-19 Thread Ray.Allen
Ray.Allen ysj@gmail.com added the comment: I am only suggesting a check for module because the is the only mistake I remember anyone reporting. Passing a number as a base class gives a similar message, but no one does that. And as far as I know, there is no way in general to

[issue11604] Have type(n,b,d) check for type(b[i]) is module

2011-03-18 Thread Terry J. Reedy
New submission from Terry J. Reedy tjre...@udel.edu: People occasionally ask on python-list about the following error message when trying to create a class: TypeError: Error when calling the metaclass bases module.__init__() takes at most 2 arguments (3 given) It is a bit cryptic. It is