Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #75790
| From | alister <alister.nospam.ware@ntlworld.com> |
|---|---|
| Subject | Re: Making every no-arg method a property? |
| Newsgroups | comp.lang.python |
| References | <mailman.12674.1407271813.18130.python-list@python.org> |
| Message-ID | <jcnEv.94293$Ha1.17400@fx10.am4> (permalink) |
| Organization | virginmedia.com |
| Date | 2014-08-06 10:12 +0000 |
On Tue, 05 Aug 2014 12:39:18 -0700, Christian Calderon 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? > <div dir="ltr">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?</div> import this Special Cases are not special enough This is a horrible idea for python code -- Once is happenstance, Twice is coincidence, Three times is enemy action. -- Auric Goldfinger
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Making every no-arg method a property? Christian Calderon <calderon.christian760@gmail.com> - 2014-08-05 12:39 -0700
Re: Making every no-arg method a property? Rob Gaddi <rgaddi@technologyhighland.invalid> - 2014-08-05 13:57 -0700
Re: Making every no-arg method a property? Grant Edwards <invalid@invalid.invalid> - 2014-08-05 21:14 +0000
Re: Making every no-arg method a property? Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-08-06 10:34 +1200
Re: Making every no-arg method a property? Grant Edwards <invalid@invalid.invalid> - 2014-08-06 05:13 +0000
Re: Making every no-arg method a property? Rob Gaddi <rgaddi@technologyhighland.invalid> - 2014-08-06 09:53 -0700
Re: Making every no-arg method a property? alister <alister.nospam.ware@ntlworld.com> - 2014-08-06 10:09 +0000
Re: Making every no-arg method a property? Terry Reedy <tjreedy@udel.edu> - 2014-08-06 15:04 -0400
Re: Making every no-arg method a property? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-06 10:49 +1000
Re: Making every no-arg method a property? Chris Angelico <rosuav@gmail.com> - 2014-08-06 12:07 +1000
Re: Making every no-arg method a property? Steven D'Aprano <steve@pearwood.info> - 2014-08-06 09:15 +0000
Re: Making every no-arg method a property? Chris Angelico <rosuav@gmail.com> - 2014-08-06 21:26 +1000
Re: Making every no-arg method a property? alister <alister.nospam.ware@ntlworld.com> - 2014-08-06 10:12 +0000
csiph-web