Enable Ruff flake8-todos (TD) (#13748)

This commit is contained in:
Avasam
2025-04-03 01:43:54 -04:00
committed by GitHub
parent bd0f64a3cc
commit 4b253d2932
14 changed files with 20 additions and 14 deletions
+1 -1
View File
@@ -292,7 +292,7 @@ class Array(_CData, Generic[_CT], metaclass=_PyCArrayType):
@raw.setter
def raw(self, value: ReadableBuffer) -> None: ...
value: Any # Note: bytes if _CT == c_char, str if _CT == c_wchar, unavailable otherwise
# TODO These methods cannot be annotated correctly at the moment.
# TODO: These methods cannot be annotated correctly at the moment.
# All of these "Any"s stand for the array's element type, but it's not possible to use _CT
# here, because of a special feature of ctypes.
# By default, when accessing an element of an Array[_CT], the returned object has type _CT.
+1 -1
View File
@@ -7,7 +7,7 @@ def hls_to_rgb(h: float, l: float, s: float) -> tuple[float, float, float]: ...
def rgb_to_hsv(r: float, g: float, b: float) -> tuple[float, float, float]: ...
def hsv_to_rgb(h: float, s: float, v: float) -> tuple[float, float, float]: ...
# TODO undocumented
# TODO: undocumented
ONE_SIXTH: float
ONE_THIRD: float
TWO_THIRD: float
+2 -2
View File
@@ -158,7 +158,7 @@ def ARRAY(typ: _CT, len: int) -> Array[_CT]: ... # Soft Deprecated, no plans to
if sys.platform == "win32":
def DllCanUnloadNow() -> int: ...
def DllGetClassObject(rclsid: Any, riid: Any, ppv: Any) -> int: ... # TODO not documented
def DllGetClassObject(rclsid: Any, riid: Any, ppv: Any) -> int: ... # TODO: not documented
# Actually just an instance of _NamedFuncPointer (aka _CDLLFuncPointer),
# but we want to set a more specific __call__
@@ -247,7 +247,7 @@ class c_bool(_SimpleCData[bool]):
def __init__(self, value: bool = ...) -> None: ...
if sys.platform == "win32":
class HRESULT(_SimpleCData[int]): ... # TODO undocumented
class HRESULT(_SimpleCData[int]): ... # TODO: undocumented
if sys.version_info >= (3, 12):
# At runtime, this is an alias for either c_int32 or c_int64,
+1 -1
View File
@@ -13,7 +13,7 @@ longopt_xlate: Final[dict[int, int]]
class FancyGetopt:
def __init__(self, option_table: list[_Option] | None = None) -> None: ...
# TODO kinda wrong, `getopt(object=object())` is invalid
# TODO: kinda wrong, `getopt(object=object())` is invalid
@overload
def getopt(
self, args: _SliceableT[_StrSequenceT_co] | None = None, object: None = None
+1 -1
View File
@@ -191,7 +191,7 @@ class SysLogHandler(Handler):
class NTEventLogHandler(Handler):
def __init__(self, appname: str, dllname: str | None = None, logtype: str = "Application") -> None: ...
def getEventCategory(self, record: LogRecord) -> int: ...
# TODO correct return value?
# TODO: correct return value?
def getEventType(self, record: LogRecord) -> int: ...
def getMessageID(self, record: LogRecord) -> int: ...
+1 -1
View File
@@ -239,7 +239,7 @@ class Values:
# __getattr__ doesn't exist, but anything passed as a default to __init__
# is set on the instance.
def __getattr__(self, name: str) -> Any: ...
# TODO mypy infers -> object for __getattr__ if __setattr__ has `value: object`
# TODO: mypy infers -> object for __getattr__ if __setattr__ has `value: object`
def __setattr__(self, name: str, value: Any, /) -> None: ...
def __eq__(self, other: object) -> bool: ...
+1 -1
View File
@@ -2556,7 +2556,7 @@ class Popen(Generic[AnyStr]):
def poll(self) -> int | None: ...
def wait(self, timeout: float | None = None) -> int: ...
# morally the members of the returned tuple should be optional
# TODO this should allow ReadableBuffer for Popen[bytes], but adding
# TODO: this should allow ReadableBuffer for Popen[bytes], but adding
# overloads for that runs into a mypy bug (python/mypy#14070).
def communicate(self, input: AnyStr | None = None, timeout: float | None = None) -> tuple[AnyStr, AnyStr]: ...
def send_signal(self, sig: int) -> None: ...
+1 -1
View File
@@ -175,7 +175,7 @@ class HTTPCookieProcessor(BaseHandler):
class ProxyHandler(BaseHandler):
def __init__(self, proxies: dict[str, str] | None = None) -> None: ...
def proxy_open(self, req: Request, proxy: str, type: str) -> _UrlopenRet | None: ... # undocumented
# TODO add a method for every (common) proxy protocol
# TODO: add a method for every (common) proxy protocol
class HTTPPasswordMgr:
def add_password(self, realm: str, uri: str | Sequence[str], user: str, passwd: str) -> None: ...
+1 -1
View File
@@ -366,7 +366,7 @@ _E = TypeVar("_E", default=Element)
class XMLParser(Generic[_E]):
parser: XMLParserType
target: _Target
# TODO-what is entity used for???
# TODO: what is entity used for???
entity: dict[str, str]
version: str
def __init__(self, *, target: _Target | None = None, encoding: str | None = None) -> None: ...