mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 14:01:55 +08:00
Add @final to many unsubclassable stdlib classes (#6299)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from typing import Any
|
||||
from typing_extensions import Literal
|
||||
from typing_extensions import Literal, final
|
||||
|
||||
# _tkinter is meant to be only used internally by tkinter, but some tkinter
|
||||
# functions e.g. return _tkinter.Tcl_Obj objects. Tcl_Obj represents a Tcl
|
||||
@@ -14,6 +14,7 @@ from typing_extensions import Literal
|
||||
# >>> text.tag_add('foo', '1.0', 'end')
|
||||
# >>> text.tag_ranges('foo')
|
||||
# (<textindex object: '1.0'>, <textindex object: '2.0'>)
|
||||
@final
|
||||
class Tcl_Obj:
|
||||
string: str # str(tclobj) returns this
|
||||
typename: str
|
||||
@@ -37,6 +38,7 @@ class TclError(Exception): ...
|
||||
#
|
||||
# eval always returns str because _tkinter_tkapp_eval_impl in _tkinter.c calls
|
||||
# Tkapp_UnicodeResult, and it returns a string when it succeeds.
|
||||
@final
|
||||
class TkappType:
|
||||
# Please keep in sync with tkinter.Tk
|
||||
def call(self, __command: Any, *args: Any) -> Any: ...
|
||||
|
||||
Reference in New Issue
Block a user