@@ -74,7 +74,6 @@ class Decimal:
7474 def from_float (cls : type [Self ], __f : float ) -> Self : ...
7575 def __bool__ (self ) -> bool : ...
7676 def compare (self , other : _Decimal , context : Context | None = ...) -> Decimal : ...
77- def __hash__ (self ) -> int : ...
7877 def as_tuple (self ) -> DecimalTuple : ...
7978 def as_integer_ratio (self ) -> tuple [int , int ]: ...
8079 def to_eng_string (self , context : Context | None = ...) -> str : ...
@@ -179,6 +178,11 @@ class _ContextManager:
179178_TrapType : TypeAlias = type [DecimalException ]
180179
181180class Context :
181+ # TODO: Context doesn't allow you to delete *any* attributes from instances of the class at runtime,
182+ # even settable attributes like `prec` and `rounding`,
183+ # but that's inexpressable in the stub.
184+ # Type checkers either ignore it or misinterpret it
185+ # if you add a `def __delattr__(self, __name: str) -> NoReturn` method to the stub
182186 prec : int
183187 rounding : str
184188 Emin : int
@@ -199,9 +203,6 @@ class Context:
199203 traps : None | dict [_TrapType , bool ] | Container [_TrapType ] = ...,
200204 _ignored_flags : list [_TrapType ] | None = ...,
201205 ) -> None : ...
202- # __setattr__() only allows to set a specific set of attributes,
203- # already defined above.
204- def __delattr__ (self , __name : str ) -> None : ...
205206 def __reduce__ (self : Self ) -> tuple [type [Self ], tuple [Any , ...]]: ...
206207 def clear_flags (self ) -> None : ...
207208 def clear_traps (self ) -> None : ...
0 commit comments