A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-March/061948.html below:

[Python-Dev] Making staticmethod objects callable?

[Python-Dev] Making staticmethod objects callable? [Python-Dev] Making staticmethod objects callable?Nicolas Fleury nidoizo at yahoo.com
Wed Mar 1 15:57:12 CET 2006
Hi,

I've posted this question on comp.lang.python, but nobody seems to 
conclude it is a bad idea, so I post it here.
http://groups.google.com/group/comp.lang.python/browse_frm/thread/6082dae1deef9161/88bb8a26750dd8c6?lnk=raot&hl=en#88bb8a26750dd8c6

Basically, should staticmethods be made callable so that the following 
would not raise an exception:

class A:
     @staticmethod
     def foo(): pass
     bar = foo()

There's workarounds, but it's really just about usability.  staticmethod 
could still return a descriptor, but additionnally callable.  Is there 
something I'm missing?  Is it error-prone in any way?

Note that I'm not a big fan of static methods myself, but I understand 
users expecting this work.

Regards,
Nicolas

More information about the Python-Dev mailing list

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