Message390594
Currently pydoc on X.sm gives:
---
sm(x, y)
A static method
---
I concur with Mark Shannon. The root problem is that Python functions and built-in functions have different behavior when assigned as class attribute. The former became an instance method, but the latter is not.
If wrap builtin open with statickmethod, the repr of open will be something like "staticmethod(<function open at 0x7f03031681b0>)" instead of just "<function open at 0x7f03031681b0>". It is confusing. It will produce a lot of questions why open (and only open) is so special. |
|
Date |
User |
Action |
Args |
2021-04-09 07:49:13 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, mark.dickinson, vstinner, methane, Mark.Shannon |
2021-04-09 07:49:13 | serhiy.storchaka | set | messageid: <1617954553.47.0.0825960331593.issue43682@roundup.psfhosted.org> |
2021-04-09 07:49:13 | serhiy.storchaka | link | issue43682 messages |
2021-04-09 07:49:12 | serhiy.storchaka | create | |
|