mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
Update csv stubs for Python3.12 (#10250)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import sys
|
||||
from _typeshed import SupportsWrite
|
||||
from collections.abc import Iterable, Iterator
|
||||
from typing import Any
|
||||
@@ -9,6 +10,9 @@ QUOTE_ALL: Literal[1]
|
||||
QUOTE_MINIMAL: Literal[0]
|
||||
QUOTE_NONE: Literal[3]
|
||||
QUOTE_NONNUMERIC: Literal[2]
|
||||
if sys.version_info >= (3, 12):
|
||||
QUOTE_STRINGS: Literal[4]
|
||||
QUOTE_NOTNULL: Literal[5]
|
||||
|
||||
# Ideally this would be `QUOTE_ALL | QUOTE_MINIMAL | QUOTE_NONE | QUOTE_NONNUMERIC`
|
||||
# However, using literals in situations like these can cause false-positives (see #7258)
|
||||
|
||||
@@ -21,6 +21,9 @@ from _csv import (
|
||||
unregister_dialect as unregister_dialect,
|
||||
writer as writer,
|
||||
)
|
||||
|
||||
if sys.version_info >= (3, 12):
|
||||
from _csv import QUOTE_STRINGS as QUOTE_STRINGS, QUOTE_NOTNULL as QUOTE_NOTNULL
|
||||
from _typeshed import SupportsWrite
|
||||
from collections.abc import Collection, Iterable, Iterator, Mapping, Sequence
|
||||
from typing import Any, Generic, TypeVar, overload
|
||||
@@ -57,6 +60,8 @@ __all__ = [
|
||||
"DictWriter",
|
||||
"unix_dialect",
|
||||
]
|
||||
if sys.version_info >= (3, 12):
|
||||
__all__ += ["QUOTE_STRINGS", "QUOTE_NOTNULL"]
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user