Skip to content

Commit

Permalink
Remove 'type: ignore' from models.db.Field.__new__, mypy fixed in pre…
Browse files Browse the repository at this point in the history
…vious commit.
  • Loading branch information
minmax committed Aug 30, 2024
1 parent d7945ab commit 66d7ad1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion django-stubs/contrib/postgres/fields/array.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ArrayField(CheckFieldDefaultMixin, Generic[_V], Field[_V | Combinable, _V]
from_db_value: Any = ...
base_field: Field[_V, _V] = ...
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
base_field: Field[Any, _V],
size: int | None = ...,
Expand Down
42 changes: 21 additions & 21 deletions django-stubs/db/models/fields/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ _I = TypeVar("_I", bound=int | None)

class IntegerField(Generic[_I], Field[_I | Combinable, _I]):
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
*,
Expand Down Expand Up @@ -173,7 +173,7 @@ class PositiveIntegerRelDbTypeMixin:

class PositiveIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField[_I]):
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
*,
Expand Down Expand Up @@ -284,7 +284,7 @@ class PositiveSmallIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField[_I])

class SmallIntegerField(IntegerField[_I]):
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
*,
Expand Down Expand Up @@ -340,7 +340,7 @@ class SmallIntegerField(IntegerField[_I]):

class BigIntegerField(IntegerField[_I]):
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
*,
Expand Down Expand Up @@ -396,7 +396,7 @@ class BigIntegerField(IntegerField[_I]):

class PositiveBigIntegerField(IntegerField[_I]):
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
*,
Expand Down Expand Up @@ -454,7 +454,7 @@ _F = TypeVar("_F", bound=float | None)

class FloatField(Generic[_F], Field[_F | Combinable, _F]):
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
*,
Expand Down Expand Up @@ -515,7 +515,7 @@ class DecimalField(Generic[_DEC], Field[_DEC | Combinable, _DEC]):
max_digits: int = ...
decimal_places: int = ...
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
*,
Expand Down Expand Up @@ -677,7 +677,7 @@ _C = TypeVar("_C", bound=str | None)

class CharField(Generic[_C], Field[_C | Combinable, _C]):
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
*,
Expand Down Expand Up @@ -737,7 +737,7 @@ class CharField(Generic[_C], Field[_C | Combinable, _C]):

class SlugField(CharField[_C]):
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
*,
Expand Down Expand Up @@ -797,7 +797,7 @@ class SlugField(CharField[_C]):

class EmailField(CharField[_C]):
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
*,
Expand Down Expand Up @@ -855,7 +855,7 @@ class EmailField(CharField[_C]):

class URLField(CharField[_C]):
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
*,
Expand Down Expand Up @@ -913,7 +913,7 @@ class URLField(CharField[_C]):

class TextField(Generic[_C], Field[_C | Combinable, _C]):
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
*,
Expand Down Expand Up @@ -1030,7 +1030,7 @@ class BooleanField(Generic[_B], Field[_B | Combinable, _B]):

class IPAddressField(Generic[_C], Field[_C | Combinable, _C]):
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
*,
Expand Down Expand Up @@ -1089,7 +1089,7 @@ class GenericIPAddressField(
Field[_C | ipaddress.IPv4Address | ipaddress.IPv6Address | Combinable, _C],
):
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
*,
Expand Down Expand Up @@ -1156,7 +1156,7 @@ class DateField(DateTimeCheckMixin, Field[_DD | Combinable, _DD]):
auto_now: bool = ...
auto_now_add: bool = ...
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
*,
Expand Down Expand Up @@ -1225,7 +1225,7 @@ class TimeField(Generic[_TM], DateTimeCheckMixin, Field[_TM | Combinable, _TM]):
auto_now: bool = ...
auto_now_add: bool = ...
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
*,
Expand Down Expand Up @@ -1294,7 +1294,7 @@ class DateTimeField(DateField[_DT]):
auto_now: bool = ...
auto_now_add: bool = ...
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
*,
Expand Down Expand Up @@ -1360,7 +1360,7 @@ _U = TypeVar("_U", bound=uuid.UUID | None)

class UUIDField(Generic[_U], Field[str | _U, _U]):
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
*,
Expand Down Expand Up @@ -1421,7 +1421,7 @@ class FilePathField(Generic[_C], Field[_C, _C]):
allow_files: bool = ...
allow_folders: bool = ...
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
*,
Expand Down Expand Up @@ -1489,7 +1489,7 @@ _BIN = TypeVar("_BIN", bound=bytes | None)

class BinaryField(Generic[_BIN], Field[_BIN | bytearray | memoryview, _BIN]):
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
*,
Expand Down Expand Up @@ -1551,7 +1551,7 @@ _TD = TypeVar("_TD", bound=timedelta | None)

class DurationField(Generic[_TD], Field[_TD, _TD]):
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
*,
Expand Down
2 changes: 1 addition & 1 deletion django-stubs/db/models/fields/json.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class JSONField(CheckFieldDefaultMixin, Field[_A | Combinable, _A]):
def get_transform(self, name: Any) -> Any: ...
def value_to_string(self, obj: Any) -> Any: ...
@overload
def __new__( # type: ignore [misc]
def __new__(
cls,
verbose_name: str | None = ...,
*,
Expand Down

0 comments on commit 66d7ad1

Please sign in to comment.