function attributes (ANN: Introducing PLY-1.0 (Python Lex-Yacc))

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Fri Jun 22 14:22:51 EDT 2001


Wed, 20 Jun 2001 11:45:49 -0400, Edward C. Jones <edcjones at erols.com> pisze:

> Perhaps "self" could be made a keyword. Then you could say:
> 
>      def p_expr_plus(t):
>         self.gram = 'expr : expr PLUS expr'

Would it assign it when the function is defined (not involed)?
I would find it confusing.

Alas, we do want to assign it when the function is defined!
So "something = expr" at the beginning of the function body
is not a good idea.

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list