[Python-Dev] Re: Decorators: vertical bar syntax

Christophe Cavalaria chris.cavalaria at free.fr
Mon Aug 9 22:04:41 CEST 2004


Fredrik Lundh wrote:

> David Eppstein wrote:
> 
>> With @, a third party tool has an unambiguous indication of whether a
>> line is a decorator.  With |, it is not possible to recognize decorators
>> with a regular expression, instead you have to do some context-free
>> parsing to determine whether some previous line has an unclosed paren
>> (in which case the | is a binop rather than a decorator).
> 
> "\
> @decorator #"
> 
> """
> @decorator
> """
> 
> (etc)

Let me continue the (etc) for you :
"""
def foo():
    return 0
"""




More information about the Python-Dev mailing list

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant