Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.041 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'override': 0.07; 'python': 0.08; 'annotations': 0.09; 'wrote:': 0.15; 'compact': 0.16; 'rantingrick': 0.16; 'url:pydev': 0.16; '16,': 0.16; 'cc:addr :python-list': 0.16; 'pm,': 0.16; 'def': 0.16; 'cc:2**0': 0.21; 'cc:no real name:2**0': 0.22; 'header:In-Reply-To:1': 0.22; 'code': 0.24; '(and': 0.27; 'pass': 0.28; 'cc:addr:python.org': 0.30; 'email name:': 0.30; 'class': 0.31; 'change.': 0.32; 'minor': 0.32; 'it.': 0.33; "i've": 0.33; 'header:User-Agent:1': 0.34; 'post': 0.34; 'idea': 0.36; 'explain': 0.36; 'received:192': 0.38; 'subject:: ': 0.38; 'created': 0.38; 'think': 0.38; 'should': 0.39; 'got': 0.39; 'url:2011': 0.64; 'benefit': 0.66; 'subject:!': 0.67; 'deal.': 0.67; 'subject:are': 0.70; 'stand': 0.71; 'header:Reply-To:1': 0.71; 'reply-to:no real name:2**0': 0.72; '02:59': 0.84 Date: Sat, 16 Jul 2011 21:45:42 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10 MIME-Version: 1.0 To: rantingrick Subject: Re: Re: Virtual functions are virtually invisible! References: <97dcpqFdndU1@mid.individual.net> <7459fd94-1fcc-4ff2-9ea4-58f66ceac4db@k27g2000yqn.googlegroups.com> In-Reply-To: <7459fd94-1fcc-4ff2-9ea4-58f66ceac4db@k27g2000yqn.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:Jy7dYky5KAUCwUW+78RjYjzYpvad40NBMNnUtwqfDeF tCM/xR3jyDadaA2vcdNjlrZx5Iz47oqo74V2fYQbH2NmD1dpQJ AfzQP/J9hEmujdMS4AZio5PAbVYfehxbYu28MZQi046YYAo/IC A/6rGfLZBb9fFg9xUKaqlSRa1FLR9dEXk23vq8PpeSVT/q9e75 0tvqkXotN+CdXgSnm+dUA== Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: d@davea.name 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: 39 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1310867158 news.xs4all.nl 23852 [2001:888:2000:d::a6]:36605 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9667 On 01/-10/-28163 02:59 PM, rantingrick wrote: > On Jul 16, 5:34 pm, Fabio Zadrozny wrote: > >> I also like the idea of override annotations and I've created a blog >> post at:http://pydev.blogspot.com/2011/06/overrideimplements-templates-on-pyd... >> to explain how I do use it (and in a way that I think should be >> standard in Python the same way it's in Java). > My hat is off to you Fabio! This is a great way to have the method > clobbering stand out. I can read this code and know EXACTLY what is > going on behind the scenes! And it also has the benefit of being very > compact as apposed to a doc-string. > > > > From Fabio's blog verbatim: > > > class A(object): > def method(self): > pass > > class B(A): > > @overrides(A.method) > def method(self): > pass > > @implements(file.write) > def write(self): > pass > > Just one small change. Change those @ signs to #, and you've got a deal. Then make a minor change to pylint, and you have a way to enforce it. -- DaveA