Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

csv module docstring imported from _csv module #114123

Closed
Labels
docsDocumentation in the Doc dir
@smontanaro

Description

@smontanaro

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.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp