Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Description
Documentation
While messing around trying to find undocumented module attributes, I noticed thatcsv.__all__ contains both__doc__ and__version__. Those inclusions are themselves weird, but I further noticed this:
from _csv import Error, __version__, writer, reader, register_dialect, \ unregister_dialect, get_dialect, list_dialects, \ field_size_limit, \ QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONNUMERIC, QUOTE_NONE, \ QUOTE_STRINGS, QUOTE_NOTNULL, \ __doc__Note that both attributes are imported from the underlying_csv module. Furthermore, the__doc__ attribute is pretty extensive.
I see no particular reason either attribute needs to be defined in the underlying C module. In particular, maintaining a docstring in C (with its constrainged multi-line string syntax) is much more difficult than in Python (with its rather nice triple-quoted string syntax).
I hope I wasn't the ultimate source of this problem. I suspect that in pulling non-performance-critical bits out of the old CSV module (when it was written entirely in C) these two attributes were just missed.