A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-March/043659.html below:

[Python-Dev] method decorators (PEP 318)

[Python-Dev] method decorators (PEP 318)Shane Holloway (IEEE) shane.holloway at ieee.org
Mon Mar 29 15:47:13 EST 2004
grr... spacing didn't quite come out right.  Blasted tabs.  Let's try 
this again:

     class Example(object):
         def foo(self, *args) [
                 synchronized(lock),
                 attributes(author='SWH', protocol=IMyProtocol),
                 myArgumentWireMarshaller,
                 ]:
             pass # Code goes here
         def bar(self, *args) [
                 synchronized(lock),
                 attributes(author='SWH', protocol=IMyProtocol),
                 myArgumentWireMarshaller,
                 ]:
             pass # Code goes here
         def baz(self, *args) [
                 synchronized(lock),
                 attributes(author='SWH', protocol=IMyProtocol),
                 myArgumentWireMarshaller,
                 ]:
             pass # Code goes here

more like:

     class Example(object):
         IMyProtocolMethod = [
             synchronized(lock),
             attributes(author='SWH', protocol=IMyProtocol),
             myArgumentWireMarshaller,
             ]

         def foo(self, *args) [methodreturns(float)] + IMyProtocolMethod:
             pass # Code goes here
         def bar(self, *args) [methodreturns(str)] + IMyProtocolMethod:
             pass # Code goes here
         def baz(self, *args) [methodreturns(int)] + IMyProtocolMethod:
             pass # Code goes here



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4