(self, default: Type, context: Context)
| 4836 | return default |
| 4837 | |
| 4838 | def check_paramspec_default(self, default: Type, context: Context) -> Type: |
| 4839 | typ = get_proper_type(default) |
| 4840 | if isinstance(typ, Parameters): |
| 4841 | for i, arg_type in enumerate(typ.arg_types): |
| 4842 | arg_ptype = get_proper_type(arg_type) |
| 4843 | if isinstance(arg_ptype, AnyType) and arg_ptype.is_from_error: |
| 4844 | self.fail(f"Argument {i} of ParamSpec default must be a type", context) |
| 4845 | elif ( |
| 4846 | isinstance(typ, AnyType) |
| 4847 | and typ.is_from_error |
| 4848 | or not isinstance(typ, (AnyType, UnboundType)) |
| 4849 | ): |
| 4850 | self.fail( |
| 4851 | "The default argument to ParamSpec must be a list expression, ellipsis, or a ParamSpec", |
| 4852 | context, |
| 4853 | ) |
| 4854 | default = AnyType(TypeOfAny.from_error) |
| 4855 | return default |
| 4856 | |
| 4857 | def check_typevartuple_default(self, default: Type, context: Context) -> Type: |
| 4858 | typ = get_proper_type(default) |
no test coverage detected