Skip to content

csv.Dialect doesn't actually subclass _csv.Dialect #12808

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 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion stdlib/_csv.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import csv
import sys
from _typeshed import SupportsWrite
from collections.abc import Iterable, Iterator
Expand All @@ -20,7 +21,7 @@ _QuotingType: TypeAlias = int

class Error(Exception): ...

_DialectLike: TypeAlias = str | Dialect | type[Dialect]
_DialectLike: TypeAlias = str | Dialect | csv.Dialect | type[Dialect | csv.Dialect]

class Dialect:
delimiter: str
Expand Down
11 changes: 9 additions & 2 deletions stdlib/csv.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ from _csv import (
QUOTE_MINIMAL as QUOTE_MINIMAL,
QUOTE_NONE as QUOTE_NONE,
QUOTE_NONNUMERIC as QUOTE_NONNUMERIC,
Dialect as _Dialect,
Error as Error,
__version__ as __version__,
_DialectLike,
Expand Down Expand Up @@ -59,7 +58,15 @@ if sys.version_info < (3, 13):

_T = TypeVar("_T")

class Dialect(_Dialect):
class Dialect:
delimiter: str
quotechar: str | None
escapechar: str | None
doublequote: bool
skipinitialspace: bool
lineterminator: str
quoting: _QuotingType
strict: bool
def __init__(self) -> None: ...

class excel(Dialect): ...
Expand Down
Loading