Making every no-arg method a property?

Rob Gaddi rgaddi at technologyhighland.invalid
Tue Aug 5 16:57:58 EDT 2014


On Tue, 5 Aug 2014 12:39:18 -0700
Christian Calderon <calderon.christian760 at gmail.com> wrote:

> I have been using python for 4 years now, and I just started learning ruby.
> I like that in ruby I don't have to type parenthesis at the end of each
> function call if I don't need to provide extra arguments. I just realized
> right now that I can do something similar in python, if I make all methods
> with only the implicitly passed 'self' into properties. Which means I can
> either do some fancy coding and make a metaclass that does this
> auto-magically, or I have to have property decorators all over the place
> :-P . I was wondering what other thought of this, is it an overly fanciful
> way of coding python, or is it an acceptable thing to do in a real project?
> Also, would anyone be interested in helping me make this metaclass?
> 
Overly fanciful to my mind.  Also, you'd eliminate the ability to talk
about the function itself rather than the value thereof.  No more
help from the interactive console.  No more passing the function as an
argument.  All to save '()', which is what tells other programmers that
you're calling a function.

-- 
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order.  See above to fix.



More information about the Python-list mailing list