Make staticmethod objects callable?
- From: Nicolas Fleury <nid_oizo@xxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 28 Feb 2006 15:17:36 -0500
Hi everyone,
I was wondering if it would make sense to make staticmethod objects callable, so that the following code would work:
class A:
@staticmethod
def foo(): pass
bar = foo()
I understand staticmethod objects don't need to implement __call__ for their other use cases, but would it still make sense to implement __call__ for that specific use case? Would it be error-prone in any way?
Thx and regards,
Nicolas
.
- Follow-Ups:
- Re: Make staticmethod objects callable?
- From: Felipe Almeida Lessa
- Re: Make staticmethod objects callable?
- From: Steven Bethard
- Re: Make staticmethod objects callable?
- Prev by Date: Re: escaping quotes
- Next by Date: Re: Thread Question
- Previous by thread: Thread Question
- Next by thread: Re: Make staticmethod objects callable?
- Index(es):
Relevant Pages
|