Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #9667

Re: Re: Virtual functions are virtually invisible!

Date 2011-07-16 21:45 -0400
From Dave Angel <d@davea.name>
Subject Re: Re: Virtual functions are virtually invisible!
References <a26063b5-7f2a-4452-898a-6fbcbaa3ed9a@j23g2000yqc.googlegroups.com> <97dcpqFdndU1@mid.individual.net> <d13c09ce-f44b-4cbe-bdd2-c997675e57da@t5g2000yqj.googlegroups.com> <mailman.1133.1310855718.1164.python-list@python.org> <7459fd94-1fcc-4ff2-9ea4-58f66ceac4db@k27g2000yqn.googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.1149.1310867158.1164.python-list@python.org> (permalink)

Show all headers | View raw


On 01/-10/-28163 02:59 PM, rantingrick wrote:
> On Jul 16, 5:34 pm, Fabio Zadrozny<fabi...@gmail.com>  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

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Virtual functions are virtually invisible! rantingrick <rantingrick@gmail.com> - 2011-07-03 15:55 -0700
  Re: Virtual functions are virtually invisible! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-04 20:43 +1200
    Re: Virtual functions are virtually invisible! rantingrick <rantingrick@gmail.com> - 2011-07-10 10:15 -0700
      Re: Virtual functions are virtually invisible! Chris Angelico <rosuav@gmail.com> - 2011-07-11 03:30 +1000
      Re: Virtual functions are virtually invisible! Michael Hrivnak <mhrivnak@hrivnak.org> - 2011-07-10 20:31 -0400
        Re: Virtual functions are virtually invisible! rantingrick <rantingrick@gmail.com> - 2011-07-10 19:35 -0700
          Re: Virtual functions are virtually invisible! Michael Hrivnak <mhrivnak@hrivnak.org> - 2011-07-11 00:45 -0400
            Re: Virtual functions are virtually invisible! rantingrick <rantingrick@gmail.com> - 2011-07-11 06:42 -0700
              Re: Virtual functions are virtually invisible! Chris Angelico <rosuav@gmail.com> - 2011-07-12 00:41 +1000
                Re: Virtual functions are virtually invisible! rantingrick <rantingrick@gmail.com> - 2011-07-11 14:46 -0700
                Re: Virtual functions are virtually invisible! Chris Angelico <rosuav@gmail.com> - 2011-07-12 18:40 +1000
              Re: Virtual functions are virtually invisible! alex23 <wuwei23@gmail.com> - 2011-07-12 22:48 -0700
      Re: Virtual functions are virtually invisible! Fabio Zadrozny <fabiofz@gmail.com> - 2011-07-16 19:34 -0300
        Re: Virtual functions are virtually invisible! rantingrick <rantingrick@gmail.com> - 2011-07-16 15:58 -0700
          Re: Re: Virtual functions are virtually invisible! Dave Angel <d@davea.name> - 2011-07-16 21:45 -0400

csiph-web