Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.051 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'python,': 0.02; 'subject:method': 0.09; 'python': 0.11; ':-p': 0.16; 'fancy': 0.16; 'metaclass': 0.16; 'coding': 0.22; 'decorators': 0.24; 'function': 0.29; 'wondering': 0.29; 'message-id:@mail.gmail.com': 0.30; 'project?': 0.31; 'anyone': 0.31; 'something': 0.35; 'received:google.com': 0.35; 'acceptable': 0.36; 'subject:?': 0.36; 'similar': 0.36; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'either': 0.39; 'real': 0.63; 'provide': 0.64; 'realized': 0.68; 'helping': 0.70; 'subject:Making': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=kHbk9WlcU8BWN+07puxsLGc14zLqtnw992DbwKtJru8=; b=yZmBQsYhUi1WySBklDf0PN6cEDyYTyKkabXoG0tip4/DVVuv9UXxH+e+UGTrr369US dJfXpzlhKRlmXS/Wopg86/rDQvY/O4SAxpYuMD9qAmtILLmWMtAOWlee1m2WOG9/QYpQ q0exnK66cTeiiAMB99PndaQ0PFFlZdtJ5A2sgWE/7zKqe556k/71yDrN5JWFrU5mWosR AMTBVQaws3wLbU+6W+eOHdNiUkNH1V6p1ip1VUhP7ufeJ2XxY7U+J+zBUPuccBc+AqN4 S9n7rcqdLs/LeoHfOjNO0zL2KqhssApaVH8oHFqBD517G/O8PG+yNrYXzGpfkJ4c4SLI +r/Q== MIME-Version: 1.0 X-Received: by 10.236.83.103 with SMTP id p67mr8753327yhe.89.1407267559015; Tue, 05 Aug 2014 12:39:19 -0700 (PDT) Date: Tue, 5 Aug 2014 12:39:18 -0700 Subject: Making every no-arg method a property? From: Christian Calderon To: python-list@python.org Content-Type: multipart/alternative; boundary=20cf301af2c3f5968804ffe702fc X-Mailman-Approved-At: Tue, 05 Aug 2014 22:50:11 +0200 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1407271813 news.xs4all.nl 2974 [2001:888:2000:d::a6]:36322 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:75754 --20cf301af2c3f5968804ffe702fc Content-Type: text/plain; charset=UTF-8 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? --20cf301af2c3f5968804ffe702fc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I have been using python for 4 years now, and I just start= ed 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 argum= ents. 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 p= roperties. Which means I can either do some fancy coding and make a metacla= ss 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 m= etaclass?
--20cf301af2c3f5968804ffe702fc--