This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: tokenize.NL undocumented
Type: Stage:
Components: Documentation Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: gvanrossum Nosy List: fdrake, gvanrossum, jhermann, tim.peters
Priority: normal Keywords:

Created on 2001-03-20 21:28 by jhermann, last changed 2022-04-10 16:03 by admin. This issue is now closed.

Messages (5)
msg3975 - (view) Author: Jürgen Hermann (jhermann) Date: 2001-03-20 21:28
In section 17.5 of the Python 2.0 Library Reference, 
the constant "NL" is not documented.
msg3976 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2001-03-20 22:58
Logged In: YES 
user_id=3066

Ping, should NL be documented?
msg3977 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2001-03-21 02:22
Logged In: YES 
user_id=31435

Yes, it should be, but Ping doesn't know about NL:  Guido 
added that one.  Python's real tokenizer has no such token 
type.  It was added because-- unlike Python's real 
tokenizer --tokenizer.py passes *everything* on to the 
client, including blank lines and comments, so passes on 
newlines that aren't NEWLINEs too.  Reassigned to Guido in 
case he remembers more about the details ...
msg3978 - (view) Author: Jürgen Hermann (jhermann) Date: 2001-03-21 03:21
Logged In: YES 
user_id=39128

tokenize.NL seems to be an empty line, as opposed to 
token.NEWLINE which is a logical line end. Insofar NL is 
comparable to COMMENT, since it has no semantic content and 
is ignorable by a parser.

1 a = \
2 2
3
4 b=4

emits these tokens:

1,0-1,1:        NAME    'a'
1,2-1,3:        OP      '='
2,0-2,1:        NUMBER  '2'
2,1-2,2:        NEWLINE '\012'
3,0-3,1:        NL      '\012'
4,0-4,1:        NAME    'b'
4,1-4,2:        OP      '='
4,2-4,3:        NUMBER  '4'
4,3-4,4:        NEWLINE '\012'
5,0-5,0:        ENDMARKER       ''
msg3979 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2001-03-22 00:24
Logged In: YES 
user_id=6380

The time machne strikes again.  Skip Montanaro added docs
for NL in February.  For proof, see:

http://python.sourceforge.net/devel-docs/lib/module-tokenize.html
History
Date User Action Args
2022-04-10 16:03:53adminsetgithub: 34201
2001-03-20 21:28:13jhermanncreate