mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-21 03:11:16 +08:00
Fixed symbol redefinition in cgi.pyi stub (#4394)
* PEP 484 says that type checkers should assume that all types used in a stub should use forward declarations even though they are not quoted. This stub is using the symbol "type" within the context of a class scope. The "type" symbol is declared within this scope, so pyright assumes that the forward declaration should be used. The solution is to define a symbol with a different name in the outer scope to avoid the name conflict. * Fixed import sort order. Co-authored-by: Eric Traut <erictr@microsoft.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import sys
|
||||
from _typeshed import SupportsGetItem, SupportsItemAccess
|
||||
from builtins import type as _type
|
||||
from typing import IO, Any, AnyStr, Dict, Iterable, Iterator, List, Mapping, Optional, Protocol, Tuple, TypeVar, Union
|
||||
|
||||
_T = TypeVar("_T", bound=FieldStorage)
|
||||
@@ -56,7 +57,7 @@ class MiniFieldStorage:
|
||||
def __repr__(self) -> str: ...
|
||||
|
||||
class FieldStorage(object):
|
||||
FieldStorageClass: Optional[type]
|
||||
FieldStorageClass: Optional[_type]
|
||||
keep_blank_values: int
|
||||
strict_parsing: int
|
||||
qs_on_post: Optional[str]
|
||||
|
||||
Reference in New Issue
Block a user