PEP305 csv package: from csv import csv?
Hamish Lawson
hbl at st-andrews.ac.uk
Tue Apr 8 10:44:02 EDT 2003
According to the documentation in progress at
http://www.python.org/dev/doc/devel/whatsnew/node14.html
use of the forthcoming csv module (as described in PEP305) requires it to
be imported from the csv package:
from csv import csv
input = open('datafile', 'rb')
reader = csv.reader(input)
for line in reader:
print line
Is there some reason why the cvs package's __init__.py doesn't import the
required names from cvs.py, so allowing the shorter form below?
import csv
input = open('datafile', 'rb')
reader = csv.reader(input)
for line in reader:
print line
Hamish Lawson
More information about the Python-list
mailing list