8000 gh-114123: migrate docstring from _csv to csv by smontanaro · Pull Request #114124 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-114123: migrate docstring from _csv to csv #114124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
move __version__ from _csv to csv, remove from csv.__all__
  • Loading branch information
smontanaro committed Jan 17, 2024
commit 64301bd0d6e22f57ba0cc4074524b0ddc0976432
7 changes: 5 additions & 2 deletions Lib/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class excel:

import re
import types
from _csv import Error, __version__, writer, reader, register_dialect, \
from _csv import Error, writer, reader, register_dialect, \
unregister_dialect, get_dialect, list_dialects, \
field_size_limit, \
QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONNUMERIC, QUOTE_NONE, \
Expand All @@ -79,9 +79,12 @@ class excel:
"Error", "Dialect", "excel", "excel_tab",
"field_size_limit", "reader", "writer",
"register_dialect", "get_dialect", "list_dialects", "Sniffer",
"unregister_dialect", "__version__", "DictReader", "DictWriter",
"unregister_dialect", "DictReader", "DictWriter",
"unix_dialect"]

__version__ = "1.0"


class Dialect:
"""Describe a CSV dialect.

Expand Down
4 changes: 0 additions & 4 deletions Lib/test/test_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -1415,10 +1415,6 @@ def test_ordered_dict_reader(self):


class MiscTestCase(unittest.TestCase):
def test__all__(self):
extra = {'__version__'}
support.check__all__(self, csv, ('csv', '_csv'), extra=extra)

def test_subclassable(self):
# issue 44089
class Foo(csv.Error): ...
Expand Down
8 changes: 0 additions & 8 deletions Modules/_csv.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ module instead.

*/

#define MODULE_VERSION "1.0"

// clinic/_csv.c.h uses internal pycore_modsupport.h API
#ifndef Py_BUILD_CORE_BUILTIN
# define Py_BUILD_CORE_MODULE 1
Expand Down Expand Up @@ -1680,12 +1678,6 @@ csv_exec(PyObject *module) {
return -1;
}

/* Add version to the module. */
if (PyModule_AddStringConstant(module, "__version__",
MODULE_VERSION) == -1) {
return -1;
}

/* Set the field limit */
module_state->field_limit = 128 * 1024;

Expand Down
0