diff --git a/django-stubs/contrib/admin/templatetags/base.pyi b/django-stubs/contrib/admin/templatetags/base.pyi index ca38fe4cf..ea10ef436 100644 --- a/django-stubs/contrib/admin/templatetags/base.pyi +++ b/django-stubs/contrib/admin/templatetags/base.pyi @@ -10,7 +10,7 @@ class InclusionAdminNode(InclusionNode): args: list[Any] func: Callable[..., Any] kwargs: dict[Any, Any] - takes_context: bool + takes_context: bool # pyright: ignore[reportIncompatibleVariableOverride] template_name: str = ... def __init__( self, diff --git a/django-stubs/contrib/contenttypes/fields.pyi b/django-stubs/contrib/contenttypes/fields.pyi index ea6b5565a..33a5102cb 100644 --- a/django-stubs/contrib/contenttypes/fields.pyi +++ b/django-stubs/contrib/contenttypes/fields.pyi @@ -67,7 +67,7 @@ class GenericForeignKey(FieldCacheMixin): def __set__(self, instance: Model, value: Any | None) -> None: ... class GenericRel(ForeignObjectRel): - field: GenericRelation + field: GenericRelation # pyright: ignore[reportIncompatibleVariableOverride] def __init__( self, field: GenericRelation, diff --git a/django-stubs/contrib/contenttypes/models.pyi b/django-stubs/contrib/contenttypes/models.pyi index 69af4dadb..289b7ccf7 100644 --- a/django-stubs/contrib/contenttypes/models.pyi +++ b/django-stubs/contrib/contenttypes/models.pyi @@ -22,7 +22,9 @@ class ContentType(models.Model): id: int app_label: models.CharField[Any] = ... model: models.CharField[Any] = ... - objects: ClassVar[ContentTypeManager] = ... + objects: ClassVar[ # pyright: ignore[reportIncompatibleVariableOverride] + ContentTypeManager + ] = ... permission_set: Manager[Permission] @property def name(self) -> str: ... diff --git a/django-stubs/contrib/postgres/fields/array.pyi b/django-stubs/contrib/postgres/fields/array.pyi index d2faca050..383e110c1 100644 --- a/django-stubs/contrib/postgres/fields/array.pyi +++ b/django-stubs/contrib/postgres/fields/array.pyi @@ -17,17 +17,18 @@ 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 = ..., verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: list[_V] | Callable[[], list[_V]] | None = ..., editable: bool = ..., @@ -51,12 +52,13 @@ class ArrayField(CheckFieldDefaultMixin, Generic[_V], Field[_V | Combinable, _V] base_field: Field[Any, _V], size: int | None = ..., verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: list[_V] | Callable[[], list[_V]] | None = ..., editable: bool = ..., diff --git a/django-stubs/contrib/postgres/fields/citext.pyi b/django-stubs/contrib/postgres/fields/citext.pyi index b85e00010..64498f979 100644 --- a/django-stubs/contrib/postgres/fields/citext.pyi +++ b/django-stubs/contrib/postgres/fields/citext.pyi @@ -20,12 +20,13 @@ class CICharField(CIText, CharField[_C]): def __init__( self: CICharField[str], verbose_name: str | bytes | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: Any = ..., editable: bool = ..., @@ -45,12 +46,13 @@ class CICharField(CIText, CharField[_C]): def __init__( self: CICharField[str | None], verbose_name: str | bytes | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: Any = ..., editable: bool = ..., @@ -74,12 +76,13 @@ class CIEmailField(CIText, EmailField[_C]): def __init__( self: CIEmailField[str], verbose_name: str | bytes | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: Any = ..., editable: bool = ..., @@ -99,12 +102,13 @@ class CIEmailField(CIText, EmailField[_C]): def __init__( self: CIEmailField[str | None], verbose_name: str | bytes | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: Any = ..., editable: bool = ..., @@ -128,12 +132,13 @@ class CITextField(CIText, TextField[_C]): def __init__( self: CITextField[str], verbose_name: str | bytes | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: Any = ..., editable: bool = ..., @@ -153,12 +158,13 @@ class CITextField(CIText, TextField[_C]): def __init__( self: CITextField[str | None], verbose_name: str | bytes | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: Any = ..., editable: bool = ..., diff --git a/django-stubs/contrib/postgres/fields/hstore.pyi b/django-stubs/contrib/postgres/fields/hstore.pyi index cc506ca9e..c5c2fd564 100644 --- a/django-stubs/contrib/postgres/fields/hstore.pyi +++ b/django-stubs/contrib/postgres/fields/hstore.pyi @@ -19,12 +19,13 @@ class HStoreField(Generic[_T], CheckFieldDefaultMixin, Field[Any, Any]): def __init__( self: HStoreField[dict[str, str | None]], verbose_name: str | bytes | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: Any = ..., editable: bool = ..., @@ -44,12 +45,13 @@ class HStoreField(Generic[_T], CheckFieldDefaultMixin, Field[Any, Any]): def __init__( self: HStoreField[dict[str, str | None] | None], verbose_name: str | bytes | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: Any = ..., editable: bool = ..., diff --git a/django-stubs/core/files/base.pyi b/django-stubs/core/files/base.pyi index 91f2632f3..632e6d0dd 100644 --- a/django-stubs/core/files/base.pyi +++ b/django-stubs/core/files/base.pyi @@ -31,7 +31,7 @@ class File(FileProxyMixin, IO[Any]): def close(self) -> None: ... class ContentFile(File): - file: StringIO + file: StringIO # pyright: ignore[reportIncompatibleVariableOverride] size: Any = ... def __init__(self, content: bytes | str, name: str | None = ...) -> None: ... def write(self, data: str) -> int: ... # type: ignore[override] diff --git a/django-stubs/core/mail/message.pyi b/django-stubs/core/mail/message.pyi index a2ae5708c..4554a8031 100644 --- a/django-stubs/core/mail/message.pyi +++ b/django-stubs/core/mail/message.pyi @@ -26,15 +26,15 @@ class MIMEMixin: ... class SafeMIMEMessage(MIMEMixin, MIMEMessage): defects: list[Any] - epilogue: None + epilogue: None # pyright: ignore[reportIncompatibleVariableOverride] policy: Policy # type: ignore [no-any-unimported] - preamble: None + preamble: None # pyright: ignore[reportIncompatibleVariableOverride] class SafeMIMEText(MIMEMixin, MIMEText): defects: list[Any] - epilogue: None + epilogue: None # pyright: ignore[reportIncompatibleVariableOverride] policy: Policy # type: ignore [no-any-unimported] - preamble: None + preamble: None # pyright: ignore[reportIncompatibleVariableOverride] encoding: str = ... def __init__( self, _text: str, _subtype: str = ..., _charset: str = ... @@ -42,9 +42,9 @@ class SafeMIMEText(MIMEMixin, MIMEText): class SafeMIMEMultipart(MIMEMixin, MIMEMultipart): defects: list[Any] - epilogue: None + epilogue: None # pyright: ignore[reportIncompatibleVariableOverride] policy: Policy # type: ignore [no-any-unimported] - preamble: None + preamble: None # pyright: ignore[reportIncompatibleVariableOverride] encoding: str = ... def __init__( self, diff --git a/django-stubs/core/serializers/json.pyi b/django-stubs/core/serializers/json.pyi index 17bd23547..56fd5bb82 100644 --- a/django-stubs/core/serializers/json.pyi +++ b/django-stubs/core/serializers/json.pyi @@ -12,6 +12,6 @@ class DjangoJSONEncoder(json.JSONEncoder): allow_nan: bool check_circular: bool ensure_ascii: bool - indent: int + indent: int # pyright: ignore[reportIncompatibleVariableOverride] skipkeys: bool sort_keys: bool diff --git a/django-stubs/core/servers/basehttp.pyi b/django-stubs/core/servers/basehttp.pyi index f659f0d58..b6f03ee6b 100644 --- a/django-stubs/core/servers/basehttp.pyi +++ b/django-stubs/core/servers/basehttp.pyi @@ -28,8 +28,8 @@ class WSGIRequestHandler(simple_server.WSGIRequestHandler): close_connection: bool connection: WSGIRequest request: WSGIRequest - rfile: BytesIO - wfile: BytesIO + rfile: BytesIO # pyright: ignore[reportIncompatibleVariableOverride] + wfile: BytesIO # pyright: ignore[reportIncompatibleVariableOverride] protocol_version: str = ... def address_string(self) -> str: ... def log_message(self, format: str, *args: Any) -> None: ... diff --git a/django-stubs/db/models/fields/__init__.pyi b/django-stubs/db/models/fields/__init__.pyi index 54a809f90..f7c7e328b 100644 --- a/django-stubs/db/models/fields/__init__.pyi +++ b/django-stubs/db/models/fields/__init__.pyi @@ -115,15 +115,16 @@ _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 = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _I | Callable[[], _I] | None = ..., db_default: _I | Func | None = ..., @@ -145,12 +146,13 @@ class IntegerField(Generic[_I], Field[_I | Combinable, _I]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _I | Callable[[], _I] = ..., db_default: _I | Func = ..., @@ -174,15 +176,16 @@ class PositiveIntegerRelDbTypeMixin: class PositiveIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField[_I]): @overload - def __new__( # type: ignore [misc] + def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _I | Callable[[], _I] | None = ..., db_default: _I | Func | None = ..., @@ -204,12 +207,13 @@ class PositiveIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField[_I]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _I | Callable[[], _I] = ..., db_default: _I | Func = ..., @@ -233,12 +237,13 @@ class PositiveSmallIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField[_I]) def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _I | Callable[[], _I] | None = ..., db_default: _I | Func | None = ..., @@ -259,12 +264,13 @@ class PositiveSmallIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField[_I]) def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _I | Callable[[], _I] = ..., db_default: _I | Func = ..., @@ -285,15 +291,16 @@ class PositiveSmallIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField[_I]) class SmallIntegerField(IntegerField[_I]): @overload - def __new__( # type: ignore [misc] + def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _I | Callable[[], _I] | None = ..., db_default: _I | Func | None = ..., @@ -315,12 +322,13 @@ class SmallIntegerField(IntegerField[_I]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _I | Callable[[], _I] = ..., db_default: _I | Func = ..., @@ -341,15 +349,16 @@ class SmallIntegerField(IntegerField[_I]): class BigIntegerField(IntegerField[_I]): @overload - def __new__( # type: ignore [misc] + def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _I | Callable[[], _I] | None = ..., db_default: _I | Func | None = ..., @@ -371,12 +380,13 @@ class BigIntegerField(IntegerField[_I]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _I | Callable[[], _I] = ..., db_default: _I | Func = ..., @@ -397,15 +407,16 @@ class BigIntegerField(IntegerField[_I]): class PositiveBigIntegerField(IntegerField[_I]): @overload - def __new__( # type: ignore [misc] + def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _I | Callable[[], _I] | None = ..., db_default: _I | Func | None = ..., @@ -427,12 +438,13 @@ class PositiveBigIntegerField(IntegerField[_I]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _I | Callable[[], _I] = ..., db_default: _I | Func = ..., @@ -455,15 +467,16 @@ _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 = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _F | Callable[[], _F] | None = ..., db_default: _F | Func | None = ..., @@ -485,12 +498,13 @@ class FloatField(Generic[_F], Field[_F | Combinable, _F]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _F | Callable[[], _F] = ..., db_default: _F | Func = ..., @@ -516,9 +530,10 @@ 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 = ..., + *, name: str | None = ..., max_digits: int = ..., decimal_places: int = ..., @@ -526,7 +541,7 @@ class DecimalField(Generic[_DEC], Field[_DEC | Combinable, _DEC]): max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _DEC | Callable[[], _DEC] | None = ..., db_default: _DEC | Func | None = ..., @@ -550,6 +565,7 @@ class DecimalField(Generic[_DEC], Field[_DEC | Combinable, _DEC]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., max_digits: int = ..., decimal_places: int = ..., @@ -557,7 +573,7 @@ class DecimalField(Generic[_DEC], Field[_DEC | Combinable, _DEC]): max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _DEC | Callable[[], _DEC] = ..., db_default: _DEC | Func = ..., @@ -681,16 +697,17 @@ _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 = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int = ..., db_collation: str | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _C | Callable[[], _C] | None = ..., db_default: _C | Func | None = ..., @@ -713,13 +730,14 @@ class CharField(Generic[_C], Field[_C | Combinable, _C]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int = ..., db_collation: str | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _C | Callable[[], _C] = ..., db_default: _C | Func = ..., @@ -741,16 +759,17 @@ 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 = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int = ..., db_collation: str | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _C | Callable[[], _C] | None = ..., db_default: _C | Func | None = ..., @@ -773,13 +792,14 @@ class SlugField(CharField[_C]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int = ..., db_collation: str | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _C | Callable[[], _C] = ..., db_default: _C | Func = ..., @@ -801,16 +821,17 @@ class SlugField(CharField[_C]): class EmailField(CharField[_C]): @overload - def __new__( # type: ignore [misc] + def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int = ..., db_collation: str | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _C | Callable[[], _C] | None = ..., db_default: _C | Func | None = ..., @@ -832,13 +853,14 @@ class EmailField(CharField[_C]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int = ..., db_collation: str | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _C | Callable[[], _C] = ..., db_default: _C | Func = ..., @@ -859,16 +881,17 @@ class EmailField(CharField[_C]): class URLField(CharField[_C]): @overload - def __new__( # type: ignore [misc] + def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int = ..., db_collation: str | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _C | Callable[[], _C] | None = ..., db_default: _C | Func | None = ..., @@ -890,13 +913,14 @@ class URLField(CharField[_C]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int = ..., db_collation: str | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _C | Callable[[], _C] = ..., db_default: _C | Func = ..., @@ -917,16 +941,17 @@ 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 = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., db_collation: str | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _C | Callable[[], _C] | None = ..., db_default: _C | Func | None = ..., @@ -948,13 +973,14 @@ class TextField(Generic[_C], Field[_C | Combinable, _C]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., db_collation: str | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _C | Callable[[], _C] = ..., db_default: _C | Func = ..., @@ -980,13 +1006,14 @@ class BooleanField(Generic[_B], Field[_B | Combinable, _B]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., db_collation: str | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _B | Callable[[], _B] | None = ..., db_default: _B | Func | None = ..., @@ -1008,13 +1035,14 @@ class BooleanField(Generic[_B], Field[_B | Combinable, _B]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., db_collation: str | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _B | Callable[[], _B] = ..., db_default: _B | Func = ..., @@ -1034,15 +1062,16 @@ 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 = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _C | Callable[[], _C] | None = ..., db_default: _C | Func | None = ..., @@ -1064,12 +1093,13 @@ class IPAddressField(Generic[_C], Field[_C | Combinable, _C]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _C | Callable[[], _C] = ..., db_default: _C | Func = ..., @@ -1093,9 +1123,10 @@ class GenericIPAddressField( Field[_C | ipaddress.IPv4Address | ipaddress.IPv6Address | Combinable, _C], ): @overload - def __new__( # type: ignore [misc] + def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., protocol: str = ..., unpack_ipv4: bool = ..., @@ -1103,7 +1134,7 @@ class GenericIPAddressField( max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _C | Callable[[], _C] | None = ..., db_default: _C | Func | None = ..., @@ -1125,6 +1156,7 @@ class GenericIPAddressField( def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., protocol: str = ..., unpack_ipv4: bool = ..., @@ -1132,7 +1164,7 @@ class GenericIPAddressField( max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _C | Callable[[], _C] = ..., db_default: _C | Func = ..., @@ -1160,9 +1192,10 @@ 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 = ..., + *, name: str | None = ..., auto_now: bool = ..., auto_now_add: bool = ..., @@ -1170,7 +1203,7 @@ class DateField(DateTimeCheckMixin, Field[_DD | Combinable, _DD]): max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _DD | Callable[[], _DD] | None = ..., db_default: _DD | Func | None = ..., @@ -1194,6 +1227,7 @@ class DateField(DateTimeCheckMixin, Field[_DD | Combinable, _DD]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., auto_now: bool = ..., auto_now_add: bool = ..., @@ -1201,7 +1235,7 @@ class DateField(DateTimeCheckMixin, Field[_DD | Combinable, _DD]): max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _DD | Callable[[], _DD] = ..., db_default: _DD | Func = ..., @@ -1229,9 +1263,10 @@ 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 = ..., + *, name: str | None = ..., auto_now: bool = ..., auto_now_add: bool = ..., @@ -1239,7 +1274,7 @@ class TimeField(Generic[_TM], DateTimeCheckMixin, Field[_TM | Combinable, _TM]): max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _TM | Callable[[], _TM] | None = ..., db_default: _TM | Func | None = ..., @@ -1263,6 +1298,7 @@ class TimeField(Generic[_TM], DateTimeCheckMixin, Field[_TM | Combinable, _TM]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., auto_now: bool = ..., auto_now_add: bool = ..., @@ -1270,7 +1306,7 @@ class TimeField(Generic[_TM], DateTimeCheckMixin, Field[_TM | Combinable, _TM]): max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _TM | Callable[[], _TM] = ..., db_default: _TM | Func = ..., @@ -1298,9 +1334,10 @@ class DateTimeField(DateField[_DT]): auto_now: bool = ... auto_now_add: bool = ... @overload - def __new__( # type: ignore [misc] + def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., auto_now: bool = ..., auto_now_add: bool = ..., @@ -1308,7 +1345,7 @@ class DateTimeField(DateField[_DT]): max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _DT | Callable[[], _DT] | None = ..., db_default: _DT | Func | None = ..., @@ -1332,6 +1369,7 @@ class DateTimeField(DateField[_DT]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., auto_now: bool = ..., auto_now_add: bool = ..., @@ -1339,7 +1377,7 @@ class DateTimeField(DateField[_DT]): max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _DT | Callable[[], _DT] = ..., db_default: _DT | Func = ..., @@ -1364,15 +1402,16 @@ _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 = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _U | Callable[[], _U] | None = ..., db_default: _U | Func | None = ..., @@ -1394,12 +1433,13 @@ class UUIDField(Generic[_U], Field[str | _U, _U]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _U | Callable[[], _U] = ..., db_default: _U | Func = ..., @@ -1425,9 +1465,10 @@ 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 = ..., + *, name: str | None = ..., path: str | Callable[..., str] = ..., match: str | None = ..., @@ -1438,7 +1479,7 @@ class FilePathField(Generic[_C], Field[_C, _C]): max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _C | Callable[[], _C] | None = ..., db_default: _C | Func | None = ..., @@ -1460,6 +1501,7 @@ class FilePathField(Generic[_C], Field[_C, _C]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., path: str | Callable[..., str] = ..., match: str | None = ..., @@ -1470,7 +1512,7 @@ class FilePathField(Generic[_C], Field[_C, _C]): max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _C | Callable[[], _C] = ..., db_default: _C | Func = ..., @@ -1493,15 +1535,16 @@ _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 = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _BIN | Callable[[], _BIN] | None = ..., db_default: _BIN | Func | None = ..., @@ -1525,12 +1568,13 @@ class BinaryField(Generic[_BIN], Field[_BIN | bytearray | memoryview, _BIN]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _BIN | Callable[[], _BIN] = ..., db_default: _BIN | Func = ..., @@ -1555,15 +1599,16 @@ _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 = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _TD | Callable[[], _TD] | None = ..., db_default: _TD | Func | None = ..., @@ -1587,12 +1632,13 @@ class DurationField(Generic[_TD], Field[_TD, _TD]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., primary_key: bool = ..., max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _TD | Callable[[], _TD] = ..., db_default: _TD | Func = ..., diff --git a/django-stubs/db/models/fields/files.pyi b/django-stubs/db/models/fields/files.pyi index af93c1f78..d28d763c9 100644 --- a/django-stubs/db/models/fields/files.pyi +++ b/django-stubs/db/models/fields/files.pyi @@ -81,11 +81,11 @@ class FileField(Field[FileDescriptor, FileDescriptor]): def generate_filename(self, instance: Model | None, filename: str) -> str: ... class ImageFileDescriptor(FileDescriptor): - field: ImageField + field: ImageField # pyright: ignore[reportIncompatibleVariableOverride] def __set__(self, instance: Model, value: str | None) -> None: ... class ImageFieldFile(ImageFile, FieldFile): - field: ImageField + field: ImageField # pyright: ignore[reportIncompatibleVariableOverride] def delete(self, save: bool = ...) -> None: ... class ImageField(FileField): diff --git a/django-stubs/db/models/fields/json.pyi b/django-stubs/db/models/fields/json.pyi index b2a078962..936507e99 100644 --- a/django-stubs/db/models/fields/json.pyi +++ b/django-stubs/db/models/fields/json.pyi @@ -20,9 +20,10 @@ 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 = ..., + *, name: str | None = ..., encoder: type[json.JSONEncoder] = ..., decoder: type[json.JSONDecoder] = ..., @@ -30,7 +31,7 @@ class JSONField(CheckFieldDefaultMixin, Field[_A | Combinable, _A]): max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: Any | Callable[[], Any] | None = ..., editable: bool = ..., @@ -52,6 +53,7 @@ class JSONField(CheckFieldDefaultMixin, Field[_A | Combinable, _A]): def __new__( cls, verbose_name: str | None = ..., + *, name: str | None = ..., encoder: type[json.JSONEncoder] = ..., decoder: type[json.JSONDecoder] = ..., @@ -59,7 +61,7 @@ class JSONField(CheckFieldDefaultMixin, Field[_A | Combinable, _A]): max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: Any | Callable[[], Any] = ..., editable: bool = ..., diff --git a/django-stubs/db/models/fields/related.pyi b/django-stubs/db/models/fields/related.pyi index 28f9042cd..d214ac09a 100644 --- a/django-stubs/db/models/fields/related.pyi +++ b/django-stubs/db/models/fields/related.pyi @@ -54,10 +54,10 @@ _ErrorMessagesToOverride = dict[str, Any] RECURSIVE_RELATIONSHIP_CONSTANT: str = ... class RelatedField(FieldCacheMixin, Generic[_ST, _GT], Field[_ST, _GT]): - one_to_many: bool = ... - one_to_one: bool = ... - many_to_many: bool = ... - many_to_one: bool = ... + one_to_many: bool = ... # pyright: ignore[reportIncompatibleVariableOverride] + one_to_one: bool = ... # pyright: ignore[reportIncompatibleVariableOverride] + many_to_many: bool = ... # pyright: ignore[reportIncompatibleVariableOverride] + many_to_one: bool = ... # pyright: ignore[reportIncompatibleVariableOverride] related_model: type[_GT] = ... opts: Any = ... def get_forward_related_filter(self, obj: Model) -> dict[str, int | UUID]: ... @@ -74,10 +74,18 @@ class RelatedField(FieldCacheMixin, Generic[_ST, _GT], Field[_ST, _GT]): _M = TypeVar("_M", bound=Model | None) class ForeignObject(Generic[_M], RelatedField[_M, _M]): - one_to_many: Literal[False] = ... - one_to_one: Literal[False] = ... - many_to_many: Literal[False] = ... - many_to_one: Literal[True] = ... + one_to_many: Literal[ # pyright: ignore[reportIncompatibleVariableOverride] + False + ] = ... + one_to_one: Literal[ # pyright: ignore[reportIncompatibleVariableOverride] + False + ] = ... + many_to_many: Literal[ # pyright: ignore[reportIncompatibleVariableOverride] + False + ] = ... + many_to_one: Literal[ # pyright: ignore[reportIncompatibleVariableOverride] + True + ] = ... related_model: type[_M] = ... @overload def __new__( @@ -86,6 +94,7 @@ class ForeignObject(Generic[_M], RelatedField[_M, _M]): on_delete: _OnDeleteOptions, from_fields: Sequence[str], to_fields: Sequence[str], + *, rel: ForeignObjectRel | None = ..., related_name: str | None = ..., related_query_name: str | None = ..., @@ -99,7 +108,7 @@ class ForeignObject(Generic[_M], RelatedField[_M, _M]): max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _M | Callable[[], _M] | None = ..., editable: bool = ..., @@ -122,6 +131,7 @@ class ForeignObject(Generic[_M], RelatedField[_M, _M]): on_delete: _OnDeleteOptions, from_fields: Sequence[str], to_fields: Sequence[str], + *, rel: ForeignObjectRel | None = ..., related_name: str | None = ..., related_query_name: str | None = ..., @@ -135,7 +145,7 @@ class ForeignObject(Generic[_M], RelatedField[_M, _M]): max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _M | Callable[[], _M] = ..., editable: bool = ..., @@ -163,6 +173,7 @@ class ForeignKey(Generic[_M], ForeignObject[_M]): cls, to: type[_M] | str, on_delete: _OnDeleteOptions, + *, to_field: str | None = ..., related_name: str | None = ..., related_query_name: str | None = ..., @@ -176,7 +187,7 @@ class ForeignKey(Generic[_M], ForeignObject[_M]): max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _M | Callable[[], _M] | None = ..., editable: bool = ..., @@ -197,6 +208,7 @@ class ForeignKey(Generic[_M], ForeignObject[_M]): cls, to: type[_M] | str, on_delete: _OnDeleteOptions, + *, to_field: str | None = ..., related_name: str | None = ..., related_query_name: str | None = ..., @@ -210,7 +222,7 @@ class ForeignKey(Generic[_M], ForeignObject[_M]): max_length: int | None = ..., unique: bool = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _M | Callable[[], _M] = ..., editable: bool = ..., @@ -247,6 +259,7 @@ class OneToOneField(Generic[_M], ForeignKey[_M]): cls, to: type[_M] | str, on_delete: _OnDeleteOptions, + *, to_field: str | None = ..., related_name: str | None = ..., related_query_name: str | None = ..., @@ -260,7 +273,7 @@ class OneToOneField(Generic[_M], ForeignKey[_M]): max_length: int | None = ..., unique: Literal[True] = ..., blank: bool = ..., - null: Literal[False] = ..., + null: Literal[False] = False, db_index: bool = ..., default: _M | Callable[[], _M] | None = ..., editable: bool = ..., @@ -281,6 +294,7 @@ class OneToOneField(Generic[_M], ForeignKey[_M]): cls, to: type[_M] | str, on_delete: _OnDeleteOptions, + *, to_field: str | None = ..., related_name: str | None = ..., related_query_name: str | None = ..., @@ -294,7 +308,7 @@ class OneToOneField(Generic[_M], ForeignKey[_M]): max_length: int | None = ..., unique: Literal[True] = ..., blank: bool = ..., - null: Literal[True] = ..., + null: Literal[True], db_index: bool = ..., default: _M | Callable[[], _M] = ..., editable: bool = ..., @@ -326,10 +340,18 @@ _MN = TypeVar("_MN", bound=Model) class ManyToManyField( Generic[_MM, _MN], RelatedField[Sequence[_MN], ManyToManyRelatedManager[_MM, _MN]] ): - one_to_many: Literal[False] = ... - one_to_one: Literal[False] = ... - many_to_many: Literal[True] = ... - many_to_one: Literal[False] = ... + one_to_many: Literal[ # pyright: ignore[reportIncompatibleVariableOverride] + False + ] = ... + one_to_one: Literal[ # pyright: ignore[reportIncompatibleVariableOverride] + False + ] = ... + many_to_many: Literal[ # pyright: ignore[reportIncompatibleVariableOverride] + True + ] = ... + many_to_one: Literal[ # pyright: ignore[reportIncompatibleVariableOverride] + False + ] = ... rel_class: Any = ... description: Any = ... has_null_arg: Any = ... diff --git a/django-stubs/db/models/fields/related_descriptors.pyi b/django-stubs/db/models/fields/related_descriptors.pyi index bbc9d8bb4..e3dcdddce 100644 --- a/django-stubs/db/models/fields/related_descriptors.pyi +++ b/django-stubs/db/models/fields/related_descriptors.pyi @@ -31,7 +31,7 @@ class ForwardManyToOneDescriptor: class ForwardOneToOneDescriptor(ForwardManyToOneDescriptor): RelatedObjectDoesNotExist: type[ObjectDoesNotExist] - field: OneToOneField[Any] + field: OneToOneField[Any] # pyright: ignore[reportIncompatibleVariableOverride] def get_object(self, instance: Model) -> Model: ... class ReverseOneToOneDescriptor: @@ -64,8 +64,8 @@ class ReverseManyToOneDescriptor: def create_reverse_many_to_one_manager(superclass: Any, rel: Any) -> Any: ... class ManyToManyDescriptor(ReverseManyToOneDescriptor): - field: RelatedField[Any, Any] - rel: ManyToManyRel + field: RelatedField[Any, Any] # pyright: ignore[reportIncompatibleVariableOverride] + rel: ManyToManyRel # pyright: ignore[reportIncompatibleVariableOverride] reverse: bool = ... def __init__(self, rel: ManyToManyRel, reverse: bool = ...) -> None: ... @property diff --git a/django-stubs/http/cookie.pyi b/django-stubs/http/cookie.pyi index 2f9214ac0..32bd0b02e 100644 --- a/django-stubs/http/cookie.pyi +++ b/django-stubs/http/cookie.pyi @@ -1,5 +1,5 @@ from http import cookies -SimpleCookie = cookies.SimpleCookie[str] +SimpleCookie = cookies.SimpleCookie def parse_cookie(cookie: str) -> dict[str, str]: ... diff --git a/django-stubs/http/response.pyi b/django-stubs/http/response.pyi index 6ae141546..6c45bcca1 100644 --- a/django-stubs/http/response.pyi +++ b/django-stubs/http/response.pyi @@ -19,7 +19,7 @@ class ResponseHeaders(CaseInsensitiveMapping[str]): class BadHeaderError(ValueError): ... class HttpResponseBase: - cookies: SimpleCookie + cookies: SimpleCookie # type: ignore [type-arg] headers: ResponseHeaders status_code: int closed: bool diff --git a/django-stubs/template/context.pyi b/django-stubs/template/context.pyi index 9f5466d2f..7b25f73fd 100644 --- a/django-stubs/template/context.pyi +++ b/django-stubs/template/context.pyi @@ -68,8 +68,8 @@ class RequestContext(Context): dicts: list[dict[str, str]] render_context: RenderContext template_name: str | None - use_l10n: None - use_tz: None + use_l10n: None # pyright: ignore[reportIncompatibleVariableOverride] + use_tz: None # pyright: ignore[reportIncompatibleVariableOverride] request: HttpRequest = ... def __init__( self, diff --git a/django-stubs/template/response.pyi b/django-stubs/template/response.pyi index 750640adf..86dfa9b7c 100644 --- a/django-stubs/template/response.pyi +++ b/django-stubs/template/response.pyi @@ -15,7 +15,7 @@ class ContentNotRenderedError(Exception): ... class SimpleTemplateResponse(HttpResponse): content: Any = ... closed: bool - cookies: SimpleCookie[Any] + cookies: SimpleCookie # type: ignore [type-arg] status_code: int rendering_attrs: Any = ... template_name: list[str] | Template | str = ... @@ -47,9 +47,9 @@ class SimpleTemplateResponse(HttpResponse): class TemplateResponse(SimpleTemplateResponse): client: Client closed: bool - context: RequestContext + context: RequestContext # pyright: ignore[reportIncompatibleVariableOverride] context_data: dict[str, Any] | None - cookies: SimpleCookie[Any] + cookies: SimpleCookie # type: ignore [type-arg] csrf_cookie_set: bool json: functools.partial[Any] redirect_chain: list[tuple[str, int]] diff --git a/django-stubs/test/client.pyi b/django-stubs/test/client.pyi index 279523c94..76bdc685b 100644 --- a/django-stubs/test/client.pyi +++ b/django-stubs/test/client.pyi @@ -52,7 +52,7 @@ _RequestData = Any | None class RequestFactory: json_encoder: type[JSONEncoder] defaults: dict[str, str] - cookies: SimpleCookie + cookies: SimpleCookie # type: ignore [type-arg] errors: BytesIO def __init__( self, diff --git a/django-stubs/utils/log.pyi b/django-stubs/utils/log.pyi index 61c0bf711..c5efafb60 100644 --- a/django-stubs/utils/log.pyi +++ b/django-stubs/utils/log.pyi @@ -36,7 +36,7 @@ class RequireDebugTrue(logging.Filter): def filter(self, record: str | LogRecord) -> bool: ... class ServerFormatter(logging.Formatter): - datefmt: None + datefmt: None # pyright: ignore[reportIncompatibleVariableOverride] style: Style = ... def __init__(self, *args: Any, **kwargs: Any) -> None: ... def uses_server_time(self) -> bool: ... diff --git a/django-stubs/utils/six.pyi b/django-stubs/utils/six.pyi index 381d068ce..e6b386279 100644 --- a/django-stubs/utils/six.pyi +++ b/django-stubs/utils/six.pyi @@ -43,7 +43,7 @@ def get_method_function(meth: types.MethodType) -> types.FunctionType: ... def get_method_self(meth: types.MethodType) -> object | None: ... def get_function_closure( fun: types.FunctionType, -) -> tuple[types._Cell, ...] | None: ... +) -> tuple[types._Cell, ...] | None: ... # pyright: ignore[reportAttributeAccessIssue] def get_function_code(fun: types.FunctionType) -> types.CodeType: ... def get_function_defaults(fun: types.FunctionType) -> tuple[Any, ...] | None: ... def get_function_globals(fun: types.FunctionType) -> dict[str, Any]: ... diff --git a/django-stubs/views/decorators/csrf.pyi b/django-stubs/views/decorators/csrf.pyi index a7b2f5fc1..32d5dcd26 100644 --- a/django-stubs/views/decorators/csrf.pyi +++ b/django-stubs/views/decorators/csrf.pyi @@ -12,7 +12,7 @@ class _EnsureCsrfToken(CsrfViewMiddleware): ... def requires_csrf_token(__view: _F) -> _F: ... class _EnsureCsrfCookie(CsrfViewMiddleware): - get_response: None + get_response: None # pyright: ignore[reportIncompatibleVariableOverride] def process_view( self, request: Any, callback: Any, callback_args: Any, callback_kwargs: Any ) -> Any: ... diff --git a/package.json b/package.json index 3126547b8..9526b74ea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "devDependencies": { - "pyright": "1.1.324" + "pyright": "1.1.378" }, "volta": { "node": "18.15.0" diff --git a/tests/pyright/test_arrays.py b/tests/pyright/test_arrays.py index dc4d9e099..d9b53bda1 100644 --- a/tests/pyright/test_arrays.py +++ b/tests/pyright/test_arrays.py @@ -34,7 +34,7 @@ class Foo(models.Model): ), Result( type="error", - message='Cannot assign member "array" for type "Foo"', + message='Cannot assign to attribute "array" for class "Foo"', line=13, column=3, ), @@ -82,7 +82,7 @@ class Foo(models.Model): ), Result( type="error", - message='Cannot assign member "array" for type "Foo"', + message='Cannot assign to attribute "array" for class "Foo"', line=15, column=3, ), @@ -133,7 +133,7 @@ class Foo(models.Model): ), Result( type="error", - message='Cannot assign member "array" for type "Foo"', + message='Cannot assign to attribute "array" for class "Foo"', line=18, column=3, ), @@ -197,7 +197,7 @@ class Foo(models.Model): ), Result( type="error", - message='Cannot assign member "array" for type "Foo"', + message='Cannot assign to attribute "array" for class "Foo"', line=19, column=3, ), diff --git a/tests/pyright/test_fields.py b/tests/pyright/test_fields.py index ce43a04fb..2358ff7d6 100644 --- a/tests/pyright/test_fields.py +++ b/tests/pyright/test_fields.py @@ -32,7 +32,7 @@ class Foo(models.Model): ), Result( type="error", - message='Cannot assign member "integer_with_choices" for type "Foo"', + message='Cannot assign to attribute "integer_with_choices" for class "Foo"', line=15, column=3, ), @@ -103,7 +103,7 @@ class Foo(models.Model): ), Result( type="error", - message='Cannot assign member "char_with_choices" for type "Foo"', + message='Cannot assign to attribute "char_with_choices" for class "Foo"', line=15, column=3, ), diff --git a/yarn.lock b/yarn.lock index 936e50ff4..8fe0d0469 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,14 +2,14 @@ # yarn lockfile v1 -fsevents@~2.3.2: +fsevents@~2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== -pyright@1.1.324: - version "1.1.324" - resolved "https://registry.yarnpkg.com/pyright/-/pyright-1.1.324.tgz#6a964835c0e1aabf039cb35d8587e0d9ce7b37bf" - integrity sha512-/Ng8G2Gb17dzQEHKgPa+Z5a6LPCLYNA4BVno1UdpDjnC9iLw0VAn5k/RNuaGkB/mhA82lV0OBcd5JEdaWcA3qg== +pyright@1.1.378: + version "1.1.378" + resolved "https://registry.yarnpkg.com/pyright/-/pyright-1.1.378.tgz#bb20dd59c4231ad9eeed77ac50edf1678f291554" + integrity sha512-lCDJUtcUGDYXOASd27WFxSM0qls/3kvblUsuWqSP+4l7z8JKgAMNRhUEw3s7h1JiRqruKi4SMMn/btgj5ZmnzA== optionalDependencies: - fsevents "~2.3.2" + fsevents "~2.3.3"