-
If we can get this to type check properly, we would have perfect support for boilerplate-free mixins:
``` typescript
declare function Blah(target: T): T & {foo: number}
@Blah
class Foo {
bar() {…
-
**Bug Report**
When using a decorator on a class method with the same name as a type used in its return type, and the method is decorated with a decorator that spans multiple lines, an erro…
-
An error occurs when loading a model using a for loop as shown below.
What could be the problem?
```py
for peft_model_id in peft_model_ids:
print(peft_model_id)
model, tokenizer =…
-
When I type my dependencies, I got an error
Example:
```python
from sqlalchemy.ext.asyncio import AsyncSession
from fastapi_cache.decorator import cache
from fastapi import APIRouter, Depends
…
-
Hi!
I was interested in using your library which simply a lot of our serialization, notably because we use frozen dataclasses extensively. We also use the abstract base classes from `collections.abc`…
-
```py
from typing import TypeVar
T = TypeVar("T")
def default(value: T | None, value_if_none: T) -> T:
return value_if_none if value is None else value
foo: list[str] | None = []
b…
-
```py
from typing import Final
foo: Final[int | None] = 1
if foo is not None:
def bar() -> None:
reveal_type(foo) # note: Revealed type is "Union[builtins.int, None]"
```
https:…
-
```py
from typing import _T
class A:...
class B(A):
a: int
class C(A):
a: int
def safe(it: _T | None) -> _T:...
b_or_c: B | C
value = safe(b_or_c)
reveal_type(value) #A, sh…
-
This replaces #14509.
**Bug Report**
The order of declarations shouldn't matter to mypy w.r.t.[^wrt] type annotations when `from __future__ import annotations` is in effect, but in the example t…
-
### Summary
Change all ID types from `int` to `*Id` newtypes for greater type safety.
### What is the feature request for?
The core library
### The Problem
Currently, this (~pseudo) cod…