[issue44941] Add check_methods function to standard library

2021-08-20 Thread Finn Mason
Finn Mason added the comment: Thank you for the suggestions. >From what I could tell, the cited python-ideas discussion was more about >checking the signature of a method. However, an issue cited by the ex-BDFL >(issue9731) was helpful. It's a similar idea that verifies that a class

[issue44941] Add check_methods function to standard library

2021-08-20 Thread Éric Araujo
Éric Araujo added the comment: FYI there was a ticket and a discussion before: https://mail.python.org/archives/list/python-id...@python.org/thread/FCGDSVWHIJHBYKS2O4RHZVLXCGSGBLQH/#FCGDSVWHIJHBYKS2O4RHZVLXCGSGBLQH Should be reviewed to see the arguments made and determine if things have

[issue44941] Add check_methods function to standard library

2021-08-19 Thread Ken Jin
Ken Jin added the comment: @finnjavier08 sorry, I'd misinterpreted your original message. Thanks for clarifying your intent! > I'd be happy to do the implementation and pull request once approval is given > and a module is decided on. I can't comment because I'm not an expert on

[issue44941] Add check_methods function to standard library

2021-08-18 Thread Finn Mason
Finn Mason added the comment: I strongly feel that `check_methods` shouldn't be in collections.abc, even though that's where it's originally found, because it's not related specifically to collections but to ABCs and classes in general. I would prefer for it to be implemented in `abc` or

[issue44941] Add check_methods function to standard library

2021-08-17 Thread Finn Mason
New submission from Finn Mason : In _collections_abc.py is a private function titled `_check_methods`. It takes a class and a number of method names (as strings), checks if the class has all of the methods, and returns NotImplemented if any are missing. The code is below: ``` def