-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Complete openpyxl metaclasses (#10736)
- Loading branch information
Showing
4 changed files
with
34 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
from typing import Any, overload | ||
|
||
class Singleton(type): | ||
def __init__(self, *args, **kw) -> None: ... | ||
def __call__(self, *args, **kw): ... | ||
@overload | ||
def __init__(self, __o: object) -> None: ... | ||
@overload | ||
def __init__(self, __name: str, __bases: tuple[type, ...], __dict: dict[str, Any], **kwds: Any) -> None: ... | ||
def __call__(self, *args: Any, **kwds: Any) -> Any: ... | ||
|
||
class Cached(type): | ||
def __init__(self, *args, **kw) -> None: ... | ||
def __call__(self, *args): ... | ||
@overload | ||
def __init__(self, __o: object) -> None: ... | ||
@overload | ||
def __init__(self, __name: str, __bases: tuple[type, ...], __dict: dict[str, Any], **kwds: Any) -> None: ... | ||
def __call__(self, *args: Any) -> Any: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
from _typeshed import Incomplete, Self | ||
|
||
from .base import * | ||
from .sequence import Sequence as Sequence | ||
|
||
class MetaStrict(type): | ||
def __new__(cls, clsname, bases, methods): ... | ||
def __new__(cls: type[Self], clsname: str, bases: tuple[type, ...], methods: dict[str, Descriptor[Incomplete]]) -> Self: ... | ||
|
||
class MetaSerialisable(type): | ||
def __new__(cls, clsname, bases, methods): ... | ||
def __new__(cls: type[Self], clsname: str, bases: tuple[type, ...], methods: dict[str, Descriptor[Incomplete]]) -> Self: ... | ||
|
||
class Strict(metaclass=MetaStrict): ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
from _typeshed import Incomplete, Self | ||
|
||
class AutoSlotProperties(type): | ||
def __new__(mcl, classname, bases, dictionary): ... | ||
def __new__(mcl: type[Self], classname: str, bases: tuple[type, ...], dictionary: dict[str, Incomplete]) -> Self: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters