[Python-Dev] pep 318, Decorators for Functions, Methods and Classes

Phillip J. Eby pje at telecommunity.com
Wed Aug 11 21:54:23 CEST 2004


At 03:44 PM 8/11/04 -0400, Jack Diederich wrote:
>I have a mostly working patch for class decorators but it gets an XXX 
>ambiguity
>between
>
>funcdef: [decorators] 'def' NAME parameters ':' suite
>and
>classdef: [decorators] 'class' NAME [ '(' testlist ')' ] ':' suite
>
>It works as advertised with the pre-decorators funcdef definition (which 
>removes the ambiguity).
>Help?


How about this?

     decorated_assignment: [decorators] (funcdef | classdef)
     classdef: 'class' NAME [ '(' testlist ')' ] ':' suite
     funcdef: 'def' NAME parameters ':' suite




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