At 12:07 PM 8/10/04 -0400, Chris King wrote: >Now, is it really that important to a user whether a method is a class >or static method? They're all called the same way (so long as they're >bound), and most users couldn't care less how a function is >implemented. If the distinction is really important to the user, then >they will presumably be prudent enough to check for this by looking >either just below the function name (or wherever decorators end up), >or by reading the docstring if the function author decided to document >that. This doesn't apply to other decorators. For example, some decorators turn a function into a property. Others change the (effective) call signature. Indeed, staticmethod changes the call signature, since there is no special first argument. In frameworks where methods can be wrapped in transactions, lock synchronization, security checks, remote communication, etc., these are all decorations that are potentially part of the interface and important for the reader to know, even if they don't look at the method body (apart from the doc string).
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4