mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-13 07:21:56 +08:00
updated package setup (#485)
* updated package setup * updated to use python 3.9 * fixed test runner * fixed typecheck tests * fixed discrepencies * added override to runner * updated travis * updated pre-commit hooks * updated dep
This commit is contained in:
committed by
GitHub
parent
a3624dec36
commit
44151c485d
@@ -18,7 +18,7 @@ def make_meta_nested_class_inherit_from_any(ctx: ClassDefContext) -> None:
|
||||
|
||||
|
||||
def get_specified_form_class(object_type: Instance) -> Optional[TypeType]:
|
||||
form_class_sym = object_type.type.get('form_class')
|
||||
form_class_sym = object_type.type.get("form_class")
|
||||
if form_class_sym and isinstance(form_class_sym.type, CallableType):
|
||||
return TypeType(form_class_sym.type.ret_type)
|
||||
return None
|
||||
@@ -28,7 +28,7 @@ def extract_proper_type_for_get_form(ctx: MethodContext) -> MypyType:
|
||||
object_type = ctx.type
|
||||
assert isinstance(object_type, Instance)
|
||||
|
||||
form_class_type = helpers.get_call_argument_type_by_name(ctx, 'form_class')
|
||||
form_class_type = helpers.get_call_argument_type_by_name(ctx, "form_class")
|
||||
if form_class_type is None or isinstance(form_class_type, NoneTyp):
|
||||
form_class_type = get_specified_form_class(object_type)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user