A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2002-April/023623.html below:

[Python-Dev] Making None a keyword

[Python-Dev] Making None a keywordGuido van Rossum guido@python.org
Fri, 26 Apr 2002 08:42:56 -0400
Here's what I have so far. :-)

*** Grammar/Grammar	15 Oct 2001 15:44:04 -0000	1.45
--- Grammar/Grammar	26 Apr 2002 12:30:36 -0000
***************
*** 80,86 ****
  term: factor (('*'|'/'|'%'|'//') factor)*
  factor: ('+'|'-'|'~') factor | power
  power: atom trailer* ('**' factor)*
! atom: '(' [testlist] ')' | '[' [listmaker] ']' | '{' [dictmaker] '}' | '`' testlist '`' | NAME | NUMBER | STRING+
  listmaker: test ( list_for | (',' test)* [','] )
  lambdef: 'lambda' [varargslist] ':' test
  trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME
--- 80,86 ----
  term: factor (('*'|'/'|'%'|'//') factor)*
  factor: ('+'|'-'|'~') factor | power
  power: atom trailer* ('**' factor)*
! atom: '(' [testlist] ')' | '[' [listmaker] ']' | '{' [dictmaker] '}' | '`' testlist '`' | NAME | NUMBER | STRING+ | 'None'
  listmaker: test ( list_for | (',' test)* [','] )
  lambdef: 'lambda' [varargslist] ':' test
  trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME

It needs to add 'None' as an alternative to all other places where
currently NAME occurs.

The Unix Makefile automatically regenerates Includes/graminit.h and
Python/graminit.c when you touch Grammar/Grammar.

For some mysterious reason, I didn't have to change the code generator
at all -- the NAME terminals and the 'None' terminal look the same to
it. :-)

--Guido van Rossum (home page: http://www.python.org/~guido/)




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