after_merge
stringlengths
28
79.6k
before_merge
stringlengths
20
79.6k
url
stringlengths
38
71
full_traceback
stringlengths
43
922k
traceback_type
stringclasses
555 values
def __init__( self, item: Union[Instance, AnyType, TypeVarType, TupleType, NoneTyp, CallableType], *, line: int = -1, column: int = -1, ) -> None: """To ensure Type[Union[A, B]] is always represented as Union[Type[A], Type[B]], item of type UnionType must be handled through make_normalized s...
def __init__( self, item: Union[Instance, AnyType, TypeVarType, TupleType, NoneTyp, CallableType], *, line: int = -1, column: int = -1, ) -> None: """To ensure Type[Union[A, B]] is always represented as Union[Type[A], Type[B]], item of type UnionType must be handled through make_normalized s...
https://github.com/python/mypy/issues/3852
$ bin/mypy python/ Traceback (most recent call last): File "bin/mypy", line 33, in <module> sys.exit(console_entry()) File "dist/lib/python3.6/mypy/__main__.py", line 7, in console_entry main(None) File "dist/lib/python3.6/mypy/main.py", line 50, in main res = type_check_only(sources, bin_dir, options) File "dist/lib/p...
AssertionError
def check_lvalue( self, lvalue: Lvalue ) -> Tuple[Optional[Type], Optional[IndexExpr], Optional[Var]]: lvalue_type = None # type: Optional[Type] index_lvalue = None # type: Optional[IndexExpr] inferred = None # type: Optional[Var] if self.is_definition(lvalue): if isinstance(lvalue, Name...
def check_lvalue( self, lvalue: Lvalue ) -> Tuple[Optional[Type], Optional[IndexExpr], Optional[Var]]: lvalue_type = None # type: Optional[Type] index_lvalue = None # type: Optional[IndexExpr] inferred = None # type: Optional[Var] if self.is_definition(lvalue): if isinstance(lvalue, Name...
https://github.com/python/mypy/issues/4046
Traceback (most recent call last): File "/Users/ambv/.venvs/mypy/bin/mypy", line 11, in <module> load_entry_point('mypy', 'console_scripts', 'mypy')() File "mypy/__main__.py", line 7, in console_entry main(None) File "mypy/main.py", line 50, in main res = type_check_only(sources, bin_dir, options) File "mypy/main.py", ...
AttributeError
def infer_function_type_arguments_using_context( self, callable: CallableType, error_context: Context ) -> CallableType: """Unify callable return type to type context to infer type vars. For example, if the return type is set[t] where 't' is a type variable of callable, and if the context is set[int], ...
def infer_function_type_arguments_using_context( self, callable: CallableType, error_context: Context ) -> CallableType: """Unify callable return type to type context to infer type vars. For example, if the return type is set[t] where 't' is a type variable of callable, and if the context is set[int], ...
https://github.com/python/mypy/issues/4046
Traceback (most recent call last): File "/Users/ambv/.venvs/mypy/bin/mypy", line 11, in <module> load_entry_point('mypy', 'console_scripts', 'mypy')() File "mypy/__main__.py", line 7, in console_entry main(None) File "mypy/main.py", line 50, in main res = type_check_only(sources, bin_dir, options) File "mypy/main.py", ...
AttributeError
def __init__( self, data_dir: str, lib_path: List[str], ignore_prefix: str, source_set: BuildSourceSet, reports: Reports, options: Options, version_id: str, plugin: Plugin, errors: Errors, ) -> None: self.start_time = time.time() self.data_dir = data_dir self.errors =...
def __init__( self, data_dir: str, lib_path: List[str], ignore_prefix: str, source_set: BuildSourceSet, reports: Reports, options: Options, version_id: str, plugin: Plugin, errors: Errors, ) -> None: self.start_time = time.time() self.data_dir = data_dir self.errors =...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def semantic_analysis_pass_three(self) -> None: assert self.tree is not None, ( "Internal error: method must be called on parsed file only" ) patches = [] # type: List[Callable[[], None]] with self.wrap_context(): self.manager.semantic_analyzer_pass3.visit_file( self.tree, s...
def semantic_analysis_pass_three(self) -> None: assert self.tree is not None, ( "Internal error: method must be called on parsed file only" ) with self.wrap_context(): self.manager.semantic_analyzer_pass3.visit_file( self.tree, self.xpath, self.options ) if self.o...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def quote_type_string(self, type_string: str) -> str: """Quotes a type representation for use in messages.""" no_quote_regex = r"^<(tuple|union): \d+ items>$" if ( type_string in ["Module", "overloaded function", "<nothing>", "<deleted>"] or re.match(no_quote_regex, type_string) is not None ...
def quote_type_string(self, type_string: str) -> str: """Quotes a type representation for use in messages.""" no_quote_regex = r"^<(tuple|union): \d+ items>$" if ( type_string in ["Module", "overloaded function", "<nothing>", "<deleted>"] or re.match(no_quote_regex, type_string) is not None ...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def format_bare(self, typ: Type, verbosity: int = 0) -> str: """ Convert a type to a relatively short string suitable for error messages. This method will return an unquoted string. If a caller doesn't need to perform post-processing on the string output, .format should be used instead. (The call...
def format_bare(self, typ: Type, verbosity: int = 0) -> str: """ Convert a type to a relatively short string suitable for error messages. This method will return an unquoted string. If a caller doesn't need to perform post-processing on the string output, .format should be used instead. (The call...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def analyze_namedtuple_classdef(self, defn: ClassDef) -> Optional[TypeInfo]: # special case for NamedTuple for base_expr in defn.base_type_exprs: if isinstance(base_expr, RefExpr): base_expr.accept(self) if base_expr.fullname == "typing.NamedTuple": node = self.lo...
def analyze_namedtuple_classdef(self, defn: ClassDef) -> Optional[TypeInfo]: # special case for NamedTuple for base_expr in defn.base_type_exprs: if isinstance(base_expr, RefExpr): base_expr.accept(self) if base_expr.fullname == "typing.NamedTuple": node = self.lo...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def analyze_base_classes(self, defn: ClassDef) -> None: """Analyze and set up base classes. This computes several attributes on the corresponding TypeInfo defn.info related to the base classes: defn.info.bases, defn.info.mro, and miscellaneous others (at least tuple_type, fallback_to_any, and is_enum.)...
def analyze_base_classes(self, defn: ClassDef) -> None: """Analyze and set up base classes. This computes several attributes on the corresponding TypeInfo defn.info related to the base classes: defn.info.bases, defn.info.mro, and miscellaneous others (at least tuple_type, fallback_to_any, and is_enum.)...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def analyze_typeddict_classdef(self, defn: ClassDef) -> bool: # special case for TypedDict possible = False for base_expr in defn.base_type_exprs: if isinstance(base_expr, RefExpr): base_expr.accept(self) if base_expr.fullname == "mypy_extensions.TypedDict" or self.is_typeddi...
def analyze_typeddict_classdef(self, defn: ClassDef) -> bool: # special case for TypedDict possible = False for base_expr in defn.base_type_exprs: if isinstance(base_expr, RefExpr): base_expr.accept(self) if base_expr.fullname == "mypy_extensions.TypedDict" or self.is_typeddi...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def type_analyzer( self, *, tvar_scope: Optional[TypeVarScope] = None, allow_tuple_literal: bool = False, aliasing: bool = False, third_pass: bool = False, ) -> TypeAnalyser: if tvar_scope is None: tvar_scope = self.tvar_scope tpan = TypeAnalyser( self.lookup_qualified, ...
def type_analyzer( self, *, tvar_scope: Optional[TypeVarScope] = None, allow_tuple_literal: bool = False, aliasing: bool = False, ) -> TypeAnalyser: if tvar_scope is None: tvar_scope = self.tvar_scope return TypeAnalyser( self.lookup_qualified, self.lookup_fully_quali...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def anal_type( self, t: Type, *, tvar_scope: Optional[TypeVarScope] = None, allow_tuple_literal: bool = False, aliasing: bool = False, third_pass: bool = False, ) -> Type: if t: a = self.type_analyzer( tvar_scope=tvar_scope, aliasing=aliasing, ...
def anal_type( self, t: Type, *, tvar_scope: Optional[TypeVarScope] = None, allow_tuple_literal: bool = False, aliasing: bool = False, ) -> Type: if t: a = self.type_analyzer( tvar_scope=tvar_scope, aliasing=aliasing, allow_tuple_literal=allow_tupl...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def analyze_alias( self, rvalue: Expression, allow_unnormalized: bool ) -> Tuple[Optional[Type], List[str]]: """Check if 'rvalue' represents a valid type allowed for aliasing (e.g. not a type variable). If yes, return the corresponding type and a list of qualified type variable names for generic aliases...
def analyze_alias( self, rvalue: Expression, allow_unnormalized: bool ) -> Tuple[Optional[Type], List[str]]: """Check if 'rvalue' represents a valid type allowed for aliasing (e.g. not a type variable). If yes, return the corresponding type and a list of qualified type variable names for generic aliases...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def process_newtype_declaration(self, s: AssignmentStmt) -> None: """Check if s declares a NewType; if yes, store it in symbol table.""" # Extract and check all information from newtype declaration name, call = self.analyze_newtype_declaration(s) if name is None or call is None: return old_...
def process_newtype_declaration(self, s: AssignmentStmt) -> None: """Check if s declares a NewType; if yes, store it in symbol table.""" # Extract and check all information from newtype declaration name, call = self.analyze_newtype_declaration(s) if name is None or call is None: return old_...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def basic_new_typeinfo(self, name: str, basetype_or_fallback: Instance) -> TypeInfo: class_def = ClassDef(name, Block([])) class_def.fullname = self.qualified_name(name) info = TypeInfo(SymbolTable(), class_def, self.cur_mod_id) class_def.info = info mro = basetype_or_fallback.type.mro if mro i...
def basic_new_typeinfo(self, name: str, basetype_or_fallback: Instance) -> TypeInfo: class_def = ClassDef(name, Block([])) class_def.fullname = self.qualified_name(name) info = TypeInfo(SymbolTable(), class_def, self.cur_mod_id) info.mro = [info] + basetype_or_fallback.type.mro info.bases = [basety...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def build_namedtuple_typeinfo( self, name: str, items: List[str], types: List[Type], default_items: Dict[str, Expression], ) -> TypeInfo: strtype = self.str_type() implicit_any = AnyType(TypeOfAny.special_form) basetuple_type = self.named_type("__builtins__.tuple", [implicit_any]) di...
def build_namedtuple_typeinfo( self, name: str, items: List[str], types: List[Type], default_items: Dict[str, Expression], ) -> TypeInfo: strtype = self.str_type() implicit_any = AnyType(TypeOfAny.special_form) basetuple_type = self.named_type("__builtins__.tuple", [implicit_any]) di...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def build_typeddict_typeinfo( self, name: str, items: List[str], types: List[Type], required_keys: Set[str] ) -> TypeInfo: fallback = ( self.named_type_or_none("typing.Mapping", [self.str_type(), self.object_type()]) or self.object_type() ) info = self.basic_new_typeinfo(name, fallback) ...
def build_typeddict_typeinfo( self, name: str, items: List[str], types: List[Type], required_keys: Set[str] ) -> TypeInfo: fallback = ( self.named_type_or_none("typing.Mapping", [self.str_type(), self.object_type()]) or self.object_type() ) def patch() -> None: # Calculate the c...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def patch() -> None: # Calculate the correct value type for the fallback Mapping. fallback.args[1] = join.join_type_list(list(info.typeddict_type.items.values()))
def patch() -> None: # Calculate the correct value type for the fallback Mapping. fallback.args[1] = join.join_type_list(types)
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def __init__( self, modules: Dict[str, MypyFile], errors: Errors, sem: SemanticAnalyzer ) -> None: self.modules = modules self.errors = errors self.sem = sem
def __init__(self, modules: Dict[str, MypyFile], errors: Errors) -> None: self.modules = modules self.errors = errors
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def visit_file( self, file_node: MypyFile, fnam: str, options: Options, patches: List[Callable[[], None]], ) -> None: self.errors.set_file(fnam, file_node.fullname()) self.options = options self.sem.options = options self.patches = patches self.is_typeshed_file = self.errors.is_t...
def visit_file(self, file_node: MypyFile, fnam: str, options: Options) -> None: self.errors.set_file(fnam, file_node.fullname()) self.options = options self.is_typeshed_file = self.errors.is_typeshed_file(fnam) with experiments.strict_optional_set(options.strict_optional): self.accept(file_node)...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def visit_func_def(self, fdef: FuncDef) -> None: self.errors.push_function(fdef.name()) self.analyze(fdef.type, fdef) super().visit_func_def(fdef) self.errors.pop_function()
def visit_func_def(self, fdef: FuncDef) -> None: self.errors.push_function(fdef.name()) self.analyze(fdef.type) super().visit_func_def(fdef) self.errors.pop_function()
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def visit_class_def(self, tdef: ClassDef) -> None: # NamedTuple base classes are validated in check_namedtuple_classdef; we don't have to # check them again here. if not tdef.info.is_named_tuple: types = list(tdef.info.bases) # type: List[Type] for tvar in tdef.type_vars: if tva...
def visit_class_def(self, tdef: ClassDef) -> None: # NamedTuple base classes are validated in check_namedtuple_classdef; we don't have to # check them again here. if not tdef.info.is_named_tuple: for type in tdef.info.bases: self.analyze(type) if tdef.info.is_protocol: ...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def visit_assignment_stmt(self, s: AssignmentStmt) -> None: """Traverse the assignment statement. This includes the actual assignment and synthetic types resulted from this assignment (if any). Currently this includes NewType, TypedDict, NamedTuple, and TypeVar. """ self.analyze(s.type, s) ...
def visit_assignment_stmt(self, s: AssignmentStmt) -> None: self.analyze(s.type) if isinstance(s.rvalue, IndexExpr) and isinstance(s.rvalue.analyzed, TypeAliasExpr): self.analyze(s.rvalue.analyzed.type) if isinstance(s.rvalue, CallExpr): if isinstance(s.rvalue.analyzed, NewTypeExpr): ...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def visit_cast_expr(self, e: CastExpr) -> None: self.analyze(e.type, e) super().visit_cast_expr(e)
def visit_cast_expr(self, e: CastExpr) -> None: self.analyze(e.type) super().visit_cast_expr(e)
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def visit_type_application(self, e: TypeApplication) -> None: for type in e.types: self.analyze(type, e) super().visit_type_application(e)
def visit_type_application(self, e: TypeApplication) -> None: for type in e.types: self.analyze(type) super().visit_type_application(e)
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def analyze( self, type: Optional[Type], node: Union[Node, SymbolTableNode], warn: bool = False ) -> None: # Recursive type warnings are only emitted on type definition 'node's, marked by 'warn' # Flags appeared during analysis of 'type' are collected in this dict. indicator = {} # type: Dict[str, bool...
def analyze(self, type: Optional[Type]) -> None: if type: analyzer = TypeAnalyserPass3(self.fail, self.options, self.is_typeshed_file) type.accept(analyzer) self.check_for_omitted_generics(type)
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def analyze_types(self, types: List[Type], node: Node) -> None: # Similar to above but for nodes with multiple types. indicator = {} # type: Dict[str, bool] for type in types: analyzer = self.make_type_analyzer(indicator) type.accept(analyzer) self.check_for_omitted_generics(type) ...
def analyze_types(self, items: List[Expression]) -> List[Type]: result = [] # type: List[Type] for node in items: try: result.append(self.anal_type(expr_to_unanalyzed_type(node))) except TypeTranslationError: self.fail("Type expected", node) result.append(Any...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def visit_for_stmt(self, s: ForStmt) -> None: self.analyze(s.index_type, s) super().visit_for_stmt(s)
def visit_for_stmt(self, s: ForStmt) -> None: if self.sem.is_module_scope(): self.analyze_lvalue(s.index, explicit_type=s.index_type is not None) s.body.accept(self) if s.else_body: s.else_body.accept(self)
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def visit_with_stmt(self, s: WithStmt) -> None: self.analyze(s.target_type, s) super().visit_with_stmt(s)
def visit_with_stmt(self, s: WithStmt) -> None: if self.sem.is_module_scope(): for n in s.target: if n: self.analyze_lvalue(n, explicit_type=s.target_type is not None) s.body.accept(self)
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def analyze_type_alias( node: Expression, lookup_func: Callable[[str, Context], SymbolTableNode], lookup_fqn_func: Callable[[str], SymbolTableNode], tvar_scope: TypeVarScope, fail_func: Callable[[str, Context], None], note_func: Callable[[str, Context], None], plugin: Plugin, options: Op...
def analyze_type_alias( node: Expression, lookup_func: Callable[[str, Context], SymbolTableNode], lookup_fqn_func: Callable[[str], SymbolTableNode], tvar_scope: TypeVarScope, fail_func: Callable[[str, Context], None], plugin: Plugin, options: Options, is_typeshed_stub: bool, allow_un...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def __init__( self, lookup_func: Callable[[str, Context], SymbolTableNode], lookup_fqn_func: Callable[[str], SymbolTableNode], tvar_scope: Optional[TypeVarScope], fail_func: Callable[[str, Context], None], note_func: Callable[[str, Context], None], plugin: Plugin, options: Options, i...
def __init__( self, lookup_func: Callable[[str, Context], SymbolTableNode], lookup_fqn_func: Callable[[str], SymbolTableNode], tvar_scope: TypeVarScope, fail_func: Callable[[str, Context], None], plugin: Plugin, options: Options, is_typeshed_stub: bool, *, aliasing: bool = False,...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def visit_unbound_type(self, t: UnboundType) -> Type: if t.optional: t.optional = False # We don't need to worry about double-wrapping Optionals or # wrapping Anys: Union simplification will take care of that. return make_optional_type(self.visit_unbound_type(t)) sym = self.looku...
def visit_unbound_type(self, t: UnboundType) -> Type: if t.optional: t.optional = False # We don't need to worry about double-wrapping Optionals or # wrapping Anys: Union simplification will take care of that. return make_optional_type(self.visit_unbound_type(t)) sym = self.looku...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def tvar_scope_frame(self) -> Iterator[None]: old_scope = self.tvar_scope if self.tvar_scope: self.tvar_scope = self.tvar_scope.method_frame() else: assert self.third_pass, "Internal error: type variable scope not given" yield self.tvar_scope = old_scope
def tvar_scope_frame(self) -> Iterator[None]: old_scope = self.tvar_scope self.tvar_scope = self.tvar_scope.method_frame() yield self.tvar_scope = old_scope
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def infer_type_variables(self, type: CallableType) -> List[Tuple[str, TypeVarExpr]]: """Return list of unique type variables referred to in a callable.""" if not self.tvar_scope: return [] # We are in third pass, nothing new here names = [] # type: List[str] tvars = [] # type: List[TypeVarExp...
def infer_type_variables(self, type: CallableType) -> List[Tuple[str, TypeVarExpr]]: """Return list of unique type variables referred to in a callable.""" names = [] # type: List[str] tvars = [] # type: List[TypeVarExpr] for arg in type.arg_types: for name, tvar_expr in arg.accept( ...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def bind_function_type_variables( self, fun_type: CallableType, defn: Context ) -> List[TypeVarDef]: """Find the type variables of the function type and bind them in our tvar_scope""" if not self.tvar_scope: return [] # We are in third pass, nothing new here if fun_type.variables: for v...
def bind_function_type_variables( self, fun_type: CallableType, defn: Context ) -> List[TypeVarDef]: """Find the type variables of the function type and bind them in our tvar_scope""" if fun_type.variables: for var in fun_type.variables: var_expr = self.lookup(var.name, var).node ...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def is_defined_type_var(self, tvar: str, context: Context) -> bool: return ( self.tvar_scope is not None and self.tvar_scope.get_binding(self.lookup(tvar, context)) is not None )
def is_defined_type_var(self, tvar: str, context: Context) -> bool: return self.tvar_scope.get_binding(self.lookup(tvar, context)) is not None
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def __init__( self, lookup_func: Callable[[str, Context], SymbolTableNode], lookup_fqn_func: Callable[[str], SymbolTableNode], fail_func: Callable[[str, Context], None], note_func: Callable[[str, Context], None], plugin: Plugin, options: Options, is_typeshed_stub: bool, indicator: Di...
def __init__( self, fail_func: Callable[[str, Context], None], options: Options, is_typeshed_stub: bool, ) -> None: self.fail = fail_func self.options = options self.is_typeshed_stub = is_typeshed_stub
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def visit_instance(self, t: Instance) -> None: info = t.type if info.replaced or info.tuple_type: self.indicator["synthetic"] = True # Check type argument count. if len(t.args) != len(info.type_vars): if len(t.args) == 0: from_builtins = ( t.type.fullname() in...
def visit_instance(self, t: Instance) -> None: info = t.type # Check type argument count. if len(t.args) != len(info.type_vars): if len(t.args) == 0: from_builtins = ( t.type.fullname() in nongen_builtins and not t.from_generic_builtin ) if ( ...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def check_type_var_values( self, type: TypeInfo, actuals: List[Type], arg_name: str, valids: List[Type], arg_number: int, context: Context, ) -> None: for actual in actuals: actual = self.update_type(actual) if not isinstance(actual, AnyType) and not any( is_s...
def check_type_var_values( self, type: TypeInfo, actuals: List[Type], arg_name: str, valids: List[Type], arg_number: int, context: Context, ) -> None: for actual in actuals: if not isinstance(actual, AnyType) and not any( is_same_type(actual, value) for value in valid...
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def visit_type_var(self, t: TypeVarType) -> None: if t.upper_bound: t.upper_bound.accept(self) if t.values: for v in t.values: v.accept(self)
def visit_type_var(self, t: TypeVarType) -> None: pass
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def visit_type_type(self, t: TypeType) -> None: t.item.accept(self)
def visit_type_type(self, t: TypeType) -> None: pass
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def anal_type(self, tp: UnboundType) -> Type: tpan = TypeAnalyser( self.lookup_func, self.lookup_fqn_func, None, self.fail, self.note_func, self.plugin, self.options, self.is_typeshed_stub, third_pass=True, ) return tp.accept(tpan)
def anal_type(self, t: Type, nested: bool = True) -> Type: if nested: self.nesting_level += 1 try: return t.accept(self) finally: if nested: self.nesting_level -= 1
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def accept(self, visitor: "TypeVisitor[T]") -> T: return visitor.visit_forwardref_type(self)
def accept(self, visitor: "TypeVisitor[T]") -> T: return visitor.visit_type_type(self)
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def serialize(self): if isinstance(self.link, UnboundType): name = self.link.name if isinstance(self.link, Instance): name = self.link.type.name() else: name = self.link.__class__.__name__ # We should never get here since all forward references should be resolved # and remove...
def serialize(self) -> JsonDict: return {".class": "TypeType", "item": self.item.serialize()}
https://github.com/python/mypy/issues/3836
mypy --show-traceback Deduction.py Deduction.py:102: error: The return type of "__init__" must be None Deduction.py:103: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty Traceback (most recent call last): File "/usr/local...
TypeError
def visit_symbol_table(self, symtab: SymbolTable) -> None: # Copy the items because we may mutate symtab. for key, value in list(symtab.items()): cross_ref = value.cross_ref if cross_ref is not None: # Fix up cross-reference. del value.cross_ref if cross_ref in self.modu...
def visit_symbol_table(self, symtab: SymbolTable) -> None: # Copy the items because we may mutate symtab. for key, value in list(symtab.items()): cross_ref = value.cross_ref if cross_ref is not None: # Fix up cross-reference. del value.cross_ref if cross_ref in self.modu...
https://github.com/python/mypy/issues/3355
build_number/__init__.py:31: error: Module 'build_number._frozen_version' has no attribute 'DROPBOXEXT_VERSION' build_number/__init__.py:102: error: "DesktopClientBuildNumber" has no attribute "name" Traceback (most recent call last): File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/py...
AssertionError
def visit_call_expr(self, e: CallExpr, allow_none_return: bool = False) -> Type: """Type check a call expression.""" if e.analyzed: # It's really a special form that only looks like a call. return self.accept(e.analyzed, self.type_context[-1]) if ( isinstance(e.callee, NameExpr) ...
def visit_call_expr(self, e: CallExpr, allow_none_return: bool = False) -> Type: """Type check a call expression.""" if e.analyzed: # It's really a special form that only looks like a call. return self.accept(e.analyzed, self.type_context[-1]) if ( isinstance(e.callee, NameExpr) ...
https://github.com/python/mypy/issues/3650
Traceback (most recent call last): File "/Users/jukka/src/mypy/scripts/mypy", line 6, in <module> main(__file__) File "/Users/jukka/src/mypy/mypy/main.py", line 50, in main res = type_check_only(sources, bin_dir, options) File "/Users/jukka/src/mypy/mypy/main.py", line 97, in type_check_only options=options) File "/Use...
IndexError
def visit_lambda_expr(self, e: LambdaExpr) -> Type: """Type check lambda expression.""" inferred_type, type_override = self.infer_lambda_type_using_context(e) if not inferred_type: self.chk.return_types.append(AnyType()) # No useful type context. ret_type = self.accept(e.expr(), allo...
def visit_lambda_expr(self, e: LambdaExpr) -> Type: """Type check lambda expression.""" inferred_type, type_override = self.infer_lambda_type_using_context(e) if not inferred_type: # No useful type context. ret_type = self.accept(e.expr(), allow_none_return=True) fallback = self.name...
https://github.com/python/mypy/issues/3243
error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues Traceback (most recent call last): File "/usr/local/bin/mypy", line 6, in <module> main(__file__) File "/usr/local/lib/python3.6/site-packages/mypy/main.py", line 42, in main res = type_check_only(sources, bin_dir, options) File "/usr...
IndexError
def on_finish(self) -> None: total_any = sum(num_any for num_any, _ in self.counts.values()) total_expr = sum(total for _, total in self.counts.values()) total_coverage = 100.0 if total_expr > 0: total_coverage = (float(total_expr - total_any) / float(total_expr)) * 100 any_column_name = "A...
def on_finish(self) -> None: total_any = sum(num_any for num_any, _ in self.counts.values()) total_expr = sum(total for _, total in self.counts.values()) total_coverage = (float(total_expr - total_any) / float(total_expr)) * 100 any_column_name = "Anys" total_column_name = "Exprs" file_column_n...
https://github.com/python/mypy/issues/3522
(v36) guido-mbp:mypy guido$ mypy --any-exprs-report=out -c 'pass' Traceback (most recent call last): File "/Users/guido/v36/bin/mypy", line 6, in <module> exec(compile(open(__file__).read(), __file__, 'exec')) File "/Users/guido/src/mypy/scripts/mypy", line 6, in <module> main(__file__) File "/Users/guido/src/mypy/mypy...
ZeroDivisionError
def analyze_property_with_multi_part_definition(self, defn: OverloadedFuncDef) -> None: """Analyze a property defined using multiple methods (e.g., using @x.setter). Assume that the first method (@property) has already been analyzed. """ defn.is_property = True items = defn.items first_item = c...
def analyze_property_with_multi_part_definition(self, defn: OverloadedFuncDef) -> None: """Analyze a property defined using multiple methods (e.g., using @x.setter). Assume that the first method (@property) has already been analyzed. """ defn.is_property = True items = defn.items first_item = c...
https://github.com/python/mypy/issues/3491
Traceback (most recent call last): File ".../bin/mypy", line 6, in <module> main(__file__) File ".../lib/python3.5/site-packages/mypy/main.py", line 46, in main res = type_check_only(sources, bin_dir, options) File ".../lib/python3.5/site-packages/mypy/main.py", line 93, in type_check_only options=options) File ".../li...
AttributeError
def check_no_global( self, n: str, ctx: Context, is_overloaded_func: bool = False ) -> None: if n in self.globals: prev_is_overloaded = isinstance(self.globals[n], OverloadedFuncDef) if is_overloaded_func and prev_is_overloaded: self.fail("Nonconsecutive overload {} found".format(n),...
def check_no_global( self, n: str, ctx: Context, is_overloaded_func: bool = False ) -> None: if n in self.globals: prev_is_overloaded = isinstance(self.globals[n], OverloadedFuncDef) if is_overloaded_func and prev_is_overloaded: self.fail("Nonconsecutive overload {} found".format(n),...
https://github.com/python/mypy/issues/3415
api/integrations/perforce/git_p4.py: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.520-dev-13b75737bb41d62ae4e7714704dcda3b446fa9f4 Traceback (most recent call last): File "/mnt/code/venvs/mypy_venv/bin/mypy", line 6, in <module> main(__file__) File "/mnt/code/venvs/my...
AttributeError
def name_already_defined(self, name: str, ctx: Context) -> None: self.fail("Name '{}' already defined".format(name), ctx)
def name_already_defined( self, name: str, ctx: Context, original_ctx: Optional[SymbolTableNode] = None ) -> None: if original_ctx: extra_msg = " on line {}".format(original_ctx.node.get_line()) else: extra_msg = "" self.fail("Name '{}' already defined{}".format(name, extra_msg), ctx)
https://github.com/python/mypy/issues/3415
api/integrations/perforce/git_p4.py: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.520-dev-13b75737bb41d62ae4e7714704dcda3b446fa9f4 Traceback (most recent call last): File "/mnt/code/venvs/mypy_venv/bin/mypy", line 6, in <module> main(__file__) File "/mnt/code/venvs/my...
AttributeError
def unexpected_keyword_argument( self, callee: CallableType, name: str, context: Context ) -> None: msg = 'Unexpected keyword argument "{}"'.format(name) if callee.name: msg += " for {}".format(callee.name) self.fail(msg, context) module = find_defining_module(self.modules, callee) if mo...
def unexpected_keyword_argument( self, callee: CallableType, name: str, context: Context ) -> None: msg = 'Unexpected keyword argument "{}"'.format(name) if callee.name: msg += " for {}".format(callee.name) self.fail(msg, context) if callee.definition: fullname = callee.definition.fu...
https://github.com/python/mypy/issues/3362
(e2e) Adam@Adams-MacBook-Pro ~/Desktop> mypy example.py --show-traceback example.py:2: error: Unexpected keyword argument "example" for "Popen" example.py:2: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.511 Traceback (most recent call last): File "/Users/Adam/.virtual...
KeyError
def visit_func_def(self, defn: FuncDef) -> None: phase_info = self.postpone_nested_functions_stack[-1] if phase_info != FUNCTION_SECOND_PHASE: self.function_stack.append(defn) # First phase of analysis for function. self.errors.push_function(defn.name()) if not defn._fullname: ...
def visit_func_def(self, defn: FuncDef) -> None: phase_info = self.postpone_nested_functions_stack[-1] if phase_info != FUNCTION_SECOND_PHASE: self.function_stack.append(defn) # First phase of analysis for function. self.errors.push_function(defn.name()) if defn.type: ...
https://github.com/python/mypy/issues/3362
(e2e) Adam@Adams-MacBook-Pro ~/Desktop> mypy example.py --show-traceback example.py:2: error: Unexpected keyword argument "example" for "Popen" example.py:2: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.511 Traceback (most recent call last): File "/Users/Adam/.virtual...
KeyError
def visit_symbol_table(self, symtab: SymbolTable) -> None: # Copy the items because we may mutate symtab. for key, value in list(symtab.items()): cross_ref = value.cross_ref if cross_ref is not None: # Fix up cross-reference. del value.cross_ref if cross_ref in self.modu...
def visit_symbol_table(self, symtab: SymbolTable) -> None: # Copy the items because we may mutate symtab. for key, value in list(symtab.items()): cross_ref = value.cross_ref if cross_ref is not None: # Fix up cross-reference. del value.cross_ref if cross_ref in self.modu...
https://github.com/python/mypy/issues/3278
$ mypy --quick --show-traceback a.py /Users/jukka/src/mypy/b.py:3: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.510-dev-c856a53fe06c0ad9193d86ab35fb86693940f273-dirty Traceback (most recent call last): File "/Users/jukka/src/mypy/scripts/mypy", line 6, in <module> mai...
AttributeError
def visit_instance(self, inst: Instance) -> None: # TODO: Combine Instances that are exactly the same? type_ref = inst.type_ref if type_ref is None: return # We've already been here. del inst.type_ref node = lookup_qualified(self.modules, type_ref, self.quick_and_dirty) if isinstance(no...
def visit_instance(self, inst: Instance) -> None: # TODO: Combine Instances that are exactly the same? type_ref = inst.type_ref if type_ref is None: return # We've already been here. del inst.type_ref node = lookup_qualified(self.modules, type_ref, self.quick_and_dirty) if isinstance(no...
https://github.com/python/mypy/issues/3278
$ mypy --quick --show-traceback a.py /Users/jukka/src/mypy/b.py:3: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.510-dev-c856a53fe06c0ad9193d86ab35fb86693940f273-dirty Traceback (most recent call last): File "/Users/jukka/src/mypy/scripts/mypy", line 6, in <module> mai...
AttributeError
def lookup_qualified_stnode( modules: Dict[str, MypyFile], name: str, quick_and_dirty: bool ) -> Optional[SymbolTableNode]: head = name rest = [] while True: if "." not in head: if not quick_and_dirty: assert "." in head, "Cannot find %s" % (name,) return ...
def lookup_qualified_stnode( modules: Dict[str, MypyFile], name: str, quick_and_dirty: bool ) -> Optional[SymbolTableNode]: head = name rest = [] while True: if "." not in head: if not quick_and_dirty: assert "." in head, "Cannot find %s" % (name,) return ...
https://github.com/python/mypy/issues/3278
$ mypy --quick --show-traceback a.py /Users/jukka/src/mypy/b.py:3: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.510-dev-c856a53fe06c0ad9193d86ab35fb86693940f273-dirty Traceback (most recent call last): File "/Users/jukka/src/mypy/scripts/mypy", line 6, in <module> mai...
AttributeError
def __init__( self, typ: mypy.nodes.TypeInfo, args: List[Type], line: int = -1, column: int = -1, erased: bool = False, ) -> None: assert typ is NOT_READY or typ.fullname() not in ["builtins.Any", "typing.Any"] self.type = typ self.args = args self.erased = erased super().__i...
def __init__( self, typ: mypy.nodes.TypeInfo, args: List[Type], line: int = -1, column: int = -1, erased: bool = False, ) -> None: assert typ is None or typ.fullname() not in ["builtins.Any", "typing.Any"] self.type = typ self.args = args self.erased = erased super().__init__...
https://github.com/python/mypy/issues/3278
$ mypy --quick --show-traceback a.py /Users/jukka/src/mypy/b.py:3: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.510-dev-c856a53fe06c0ad9193d86ab35fb86693940f273-dirty Traceback (most recent call last): File "/Users/jukka/src/mypy/scripts/mypy", line 6, in <module> mai...
AttributeError
def __init__(self, items: List["OverloadPart"]) -> None: assert len(items) > 0 self.items = items self.impl = None self.set_line(items[0].line)
def __init__(self, items: List["OverloadPart"]) -> None: self.items = items self.impl = None self.set_line(items[0].line)
https://github.com/python/mypy/issues/3333
# mypy --show-traceback test.py test.py:26: error: Name 'do_chain' already defined test.py:22: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.510 Traceback (most recent call last): File "mypys", line 6, in <module> main(__file__) File "/tmp/mypy-0.510/mypy/main.py", lin...
IndexError
def visit_overloaded_func_def(self, defn: OverloadedFuncDef) -> None: # OverloadedFuncDef refers to any legitimate situation where you have # more than one declaration for the same function in a row. This occurs # with a @property with a setter or a deleter, and for a classic # @overload. # Decide...
def visit_overloaded_func_def(self, defn: OverloadedFuncDef) -> None: # OverloadedFuncDef refers to any legitimate situation where you have # more than one declaration for the same function in a row. This occurs # with a @property with a setter or a deleter, and for a classic # @overload. # Decide...
https://github.com/python/mypy/issues/3333
# mypy --show-traceback test.py test.py:26: error: Name 'do_chain' already defined test.py:22: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.510 Traceback (most recent call last): File "mypys", line 6, in <module> main(__file__) File "/tmp/mypy-0.510/mypy/main.py", lin...
IndexError
def analyze_namedtuple_classdef(self, defn: ClassDef) -> bool: # special case for NamedTuple for base_expr in defn.base_type_exprs: if isinstance(base_expr, RefExpr): base_expr.accept(self) if base_expr.fullname == "typing.NamedTuple": node = self.lookup(defn.name...
def analyze_namedtuple_classdef(self, defn: ClassDef) -> bool: # special case for NamedTuple for base_expr in defn.base_type_exprs: if isinstance(base_expr, RefExpr): base_expr.accept(self) if base_expr.fullname == "typing.NamedTuple": node = self.lookup(defn.name...
https://github.com/python/mypy/issues/3317
Traceback (most recent call last): File "/Users/daenyth/Curata/observer/.tox/mypy/bin/mypy", line 6, in <module> main(__file__) File "/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/main.py", line 46, in main res = type_check_only(sources, bin_dir, options) File "/Users/daenyth/Curata/observer...
TypeError
def build_namedtuple_typeinfo( self, name: str, items: List[str], types: List[Type], default_items: Dict[str, Expression], ) -> TypeInfo: strtype = self.str_type() basetuple_type = self.named_type("__builtins__.tuple", [AnyType()]) dictype = ( self.named_type_or_none("builtins.di...
def build_namedtuple_typeinfo( self, name: str, items: List[str], types: List[Type], default_items: Dict[str, Expression], ) -> TypeInfo: strtype = self.str_type() basetuple_type = self.named_type("__builtins__.tuple", [AnyType()]) dictype = ( self.named_type_or_none("builtins.di...
https://github.com/python/mypy/issues/3315
(venv) jelle@devjelle:~/mypy$ cat testnt.py from typing import NamedTuple class A(NamedTuple): b: 'B' x: int class B: pass (venv) jelle@devjelle:~/mypy$ python -m mypy --show-traceback testnt.py testnt.py:3: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.510-dev-09e7b...
AssertionError
def infer_partial_type(self, name: Var, lvalue: Lvalue, init_type: Type) -> bool: if isinstance(init_type, (NoneTyp, UninhabitedType)): partial_type = PartialType(None, name, [init_type]) elif isinstance(init_type, Instance): fullname = init_type.type.fullname() if ( isinstan...
def infer_partial_type(self, name: Var, lvalue: Lvalue, init_type: Type) -> bool: if isinstance(init_type, (NoneTyp, UninhabitedType)): partial_type = PartialType(None, name, [init_type]) elif isinstance(init_type, Instance): fullname = init_type.type.fullname() if ( isinstan...
https://github.com/python/mypy/issues/2998
myfile.py:270: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues Traceback (most recent call last): File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main "__main__", mod_spec) File "/usr/lib/python3.4/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/...
AssertionError
def analyze_super(self, e: SuperExpr, is_lvalue: bool) -> Type: """Type check a super expression.""" if e.info and e.info.bases: # TODO fix multiple inheritance etc if len(e.info.mro) < 2: self.chk.fail( "Internal error: unexpected mro for {}: {}".format( ...
def analyze_super(self, e: SuperExpr, is_lvalue: bool) -> Type: """Type check a super expression.""" if e.info and e.info.bases: # TODO fix multiple inheritance etc if len(e.info.mro) < 2: self.chk.fail( "Internal error: unexpected mro for {}: {}".format( ...
https://github.com/python/mypy/issues/2848
Traceback (most recent call last): File "/usr/local/bin/mypy", line 6, in <module> main(__file__) File "/usr/local/lib/python3.4/dist-packages/mypy/main.py", line 42, in main res = type_check_only(sources, bin_dir, options) File "/usr/local/lib/python3.4/dist-packages/mypy/main.py", line 86, in type_check_only options=...
AttributeError
def add_ancestors(self) -> None: if self.path is not None: _, name = os.path.split(self.path) base, _ = os.path.splitext(name) if "." in base: # This is just a weird filename, don't add anything self.ancestors = [] return # All parent packages are new ...
def add_ancestors(self) -> None: # All parent packages are new ancestors. ancestors = [] parent = self.id while "." in parent: parent, _ = parent.rsplit(".", 1) ancestors.append(parent) self.ancestors = ancestors
https://github.com/python/mypy/issues/2558
Traceback (most recent call last): File "/usr/local/lib/python3.6/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/Users/guido/src/mypy/mypy/__main__.py", line 5, in <module> main(None) File "/Users/guido/src...
AssertionError
def crawl_up(arg: str) -> Tuple[str, str]: """Given a .py[i] filename, return (root directory, module). We crawl up the path until we find a directory without __init__.py[i], or until we run out of path components. """ dir, mod = os.path.split(arg) mod = strip_py(mod) or mod while dir and g...
def crawl_up(arg: str) -> Tuple[str, str]: """Given a .py[i] filename, return (root directory, module). We crawl up the path until we find a directory without __init__.py[i], or until we run out of path components. """ dir, mod = os.path.split(arg) mod = strip_py(mod) or mod assert "." not ...
https://github.com/python/mypy/issues/2558
Traceback (most recent call last): File "/usr/local/lib/python3.6/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/Users/guido/src/mypy/mypy/__main__.py", line 5, in <module> main(None) File "/Users/guido/src...
AssertionError
def main(script_path: str) -> None: """Main entry point to the type checker. Args: script_path: Path to the 'mypy' script (used for finding data files). """ t0 = time.time() if script_path: bin_dir = find_bin_directory(script_path) else: bin_dir = None sys.setrecursi...
def main(script_path: str) -> None: """Main entry point to the type checker. Args: script_path: Path to the 'mypy' script (used for finding data files). """ t0 = time.time() if script_path: bin_dir = find_bin_directory(script_path) else: bin_dir = None sys.setrecursi...
https://github.com/python/mypy/issues/2893
Traceback (most recent call last): File "/home/.../bin/mypy", line 6, in <module> main(__file__) File "/home/.../lib/python3.5/site-packages/mypy/main.py", line 53, in main f.write(m + '\n') BrokenPipeError: [Errno 32] Broken pipe
BrokenPipeError
def setup_class_def_analysis(self, defn: ClassDef) -> None: """Prepare for the analysis of a class definition.""" if not defn.info: defn.info = TypeInfo(SymbolTable(), defn, self.cur_mod_id) defn.info._fullname = defn.info.name() if self.is_func_scope() or self.type: kind = MDEF ...
def setup_class_def_analysis(self, defn: ClassDef) -> None: """Prepare for the analysis of a class definition.""" if not defn.info: defn.info = TypeInfo(SymbolTable(), defn, self.cur_mod_id) defn.info._fullname = defn.info.name() if self.is_func_scope() or self.type: kind = MDEF ...
https://github.com/python/mypy/issues/2559
$ rm -rf .mypy_cache/ $ mypy -i main.py main.py:1: error: Name 'blah' is not defined $ mypy -i main.py Traceback (most recent call last): File "/usr/local/lib/python3.6/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_global...
AssertionError
def check_simple_str_interpolation( self, specifiers: List[ConversionSpecifier], replacements: Expression ) -> None: checkers = self.build_replacement_checkers(specifiers, replacements) if checkers is None: return rhs_type = self.accept(replacements) rep_types = [] # type: List[Type] i...
def check_simple_str_interpolation( self, specifiers: List[ConversionSpecifier], replacements: Expression ) -> None: checkers = self.build_replacement_checkers(specifiers, replacements) if checkers is None: return rhs_type = self.accept(replacements) rep_types = [] # type: List[Type] i...
https://github.com/python/mypy/issues/2794
Traceback (most recent call last): File "/usr/local/bin/mypy", line 6, in <module> main(__file__) File "/usr/local/lib/python3.6/site-packages/mypy/main.py", line 42, in main res = type_check_only(sources, bin_dir, options) File "/usr/local/lib/python3.6/site-packages/mypy/main.py", line 87, in type_check_only options=...
AttributeError
def visit_Subscript(self, n: ast35.Subscript) -> Type: if not isinstance(n.slice, ast35.Index): self.fail(TYPE_COMMENT_SYNTAX_ERROR, self.line, getattr(n, "col_offset", -1)) return AnyType() empty_tuple_index = False if isinstance(n.slice.value, ast35.Tuple): params = self.translate...
def visit_Subscript(self, n: ast35.Subscript) -> Type: if not isinstance(n.slice, ast35.Index): self.fail(TYPE_COMMENT_SYNTAX_ERROR, self.line, getattr(n, "col_offset", -1)) return AnyType() value = self.visit(n.value) assert isinstance(value, UnboundType) assert not value.args em...
https://github.com/python/mypy/issues/2834
Traceback (most recent call last): File "/usr/local/bin/mypy", line 6, in <module> main(__file__) File "/usr/local/lib/python3.4/dist-packages/mypy/main.py", line 42, in main res = type_check_only(sources, bin_dir, options) File "/usr/local/lib/python3.4/dist-packages/mypy/main.py", line 86, in type_check_only options=...
AssertionError
def visit_Attribute(self, n: ast35.Attribute) -> Type: before_dot = self.visit(n.value) if isinstance(before_dot, UnboundType) and not before_dot.args: return UnboundType("{}.{}".format(before_dot.name, n.attr), line=self.line) else: self.fail(TYPE_COMMENT_AST_ERROR, self.line, getattr(n, "...
def visit_Attribute(self, n: ast35.Attribute) -> Type: before_dot = self.visit(n.value) assert isinstance(before_dot, UnboundType) assert not before_dot.args return UnboundType("{}.{}".format(before_dot.name, n.attr), line=self.line)
https://github.com/python/mypy/issues/2834
Traceback (most recent call last): File "/usr/local/bin/mypy", line 6, in <module> main(__file__) File "/usr/local/lib/python3.4/dist-packages/mypy/main.py", line 42, in main res = type_check_only(sources, bin_dir, options) File "/usr/local/lib/python3.4/dist-packages/mypy/main.py", line 86, in type_check_only options=...
AssertionError
def analyze_ordinary_member_access(self, e: MemberExpr, is_lvalue: bool) -> Type: """Analyse member expression or member lvalue.""" if e.kind is not None: # This is a reference to a module attribute. return self.analyze_ref_expr(e) else: # This is a reference to a non-module attribut...
def analyze_ordinary_member_access(self, e: MemberExpr, is_lvalue: bool) -> Type: """Analyse member expression or member lvalue.""" if e.kind is not None: # This is a reference to a module attribute. return self.analyze_ref_expr(e) else: # This is a reference to a non-module attribut...
https://github.com/python/mypy/issues/2804
Traceback (most recent call last): File "/usr/local/lib/python3.6/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/Users/guido/src/mypy/mypy/__main__.py", line 5, in <module> main(None) File "/Users/guido/src...
AssertionError
def apply_generic_arguments( callable: CallableType, types: List[Type], msg: MessageBuilder, context: Context ) -> CallableType: """Apply generic type arguments to a callable type. For example, applying [int] to 'def [T] (T) -> T' results in 'def (int) -> int'. Note that each type can be None; in ...
def apply_generic_arguments( callable: CallableType, types: List[Type], msg: MessageBuilder, context: Context ) -> CallableType: """Apply generic type arguments to a callable type. For example, applying [int] to 'def [T] (T) -> T' results in 'def (int) -> int'. Note that each type can be None; in ...
https://github.com/python/mypy/issues/1587
Traceback (most recent call last): File "/usr/local/bin/mypy", line 6, in <module> main(__file__) File "/usr/local/lib/python3.5/site-packages/mypy/main.py", line 54, in main res = type_check_only(sources, bin_dir, options) File "/usr/local/lib/python3.5/site-packages/mypy/main.py", line 102, in type_check_only python_...
AssertionError
def visit_tuple_type(self, left: TupleType) -> bool: right = self.right if isinstance(right, Instance): if is_named_instance(right, "typing.Sized"): return True elif ( is_named_instance(right, "builtins.tuple") or is_named_instance(right, "typing.Iterable") ...
def visit_tuple_type(self, left: TupleType) -> bool: right = self.right if isinstance(right, Instance): if is_named_instance(right, "typing.Sized"): return True elif ( is_named_instance(right, "builtins.tuple") or is_named_instance(right, "typing.Iterable") ...
https://github.com/python/mypy/issues/2662
$ mypy --show-traceback repro.py repro.py:11: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues Traceback (most recent call last): File "/home/adrake/ve/app/bin/mypy", line 6, in <module> main(__file__) File "/home/adrake/ve/app/lib/python3.5/site-packages/mypy/main.py", line 41, in ...
IndexError
def analyze_class_attribute_access( itype: Instance, name: str, context: Context, is_lvalue: bool, builtin_type: Callable[[str], Instance], not_ready_callback: Callable[[str, Context], None], msg: MessageBuilder, original_type: Type, ) -> Type: """original_type is the type of E in th...
def analyze_class_attribute_access( itype: Instance, name: str, context: Context, is_lvalue: bool, builtin_type: Callable[[str], Instance], not_ready_callback: Callable[[str, Context], None], msg: MessageBuilder, original_type: Type, ) -> Type: """original_type is the type of E in th...
https://github.com/python/mypy/issues/2530
test2.py: note: In function "example": test2.py:9: error: Invalid type "A" test2.py:8: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues Traceback (most recent call last): File "/usr/local/bin/mypy", line 6, in <module> main(__file__) File "/usr/local/lib/python3.5/dist-packages/mypy...
AttributeError
def visit_import_all(self, i: ImportAll) -> None: i_id = self.correct_relative_import(i) if i_id in self.modules: m = self.modules[i_id] self.add_submodules_to_parent_modules(i_id, True) for name, node in m.names.items(): node = self.normalize_type_alias(node, i) ...
def visit_import_all(self, i: ImportAll) -> None: i_id = self.correct_relative_import(i) if i_id in self.modules: m = self.modules[i_id] self.add_submodules_to_parent_modules(i_id, True) for name, node in m.names.items(): node = self.normalize_type_alias(node, i) ...
https://github.com/python/mypy/issues/2315
ryan@DevPC-LX ~/blaze-mypy/bug master $ mypy x.py --show-traceback x.py:1: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues Traceback (most recent call last): File "/media/ryan/stuff/anaconda/bin/mypy", line 6, in <module> exec(compile(open(__file__).read(), __file__, 'exec')) File ...
AttributeError
def visit_try_stmt(self, s: TryStmt) -> Type: """Type check a try statement.""" completed_frames = [] # type: List[Frame] self.binder.push_frame() self.binder.try_frames.add(len(self.binder.frames) - 2) self.accept(s.body) self.binder.try_frames.remove(len(self.binder.frames) - 2) self.brea...
def visit_try_stmt(self, s: TryStmt) -> Type: """Type check a try statement.""" completed_frames = [] # type: List[Frame] self.binder.push_frame() self.binder.try_frames.add(len(self.binder.frames) - 2) self.accept(s.body) self.binder.try_frames.remove(len(self.binder.frames) - 2) if s.else...
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def __init__(self) -> None: # The stack of frames currently used. These map # expr.literal_hash -- literals like 'foo.bar' -- # to types. The last element of this list is the # top-most, current frame. Each earlier element # records the state as of when that frame was last # on top of the stack...
def __init__(self) -> None: # The set of frames currently used. These map # expr.literal_hash -- literals like 'foo.bar' -- # to types. self.frames = [Frame()] # For frames higher in the stack, we record the set of # Frames that can escape there self.options_on_return = [] # type: List[Li...
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def _add_dependencies(self, key: Key, value: Key = None) -> None: if value is None: value = key else: self.dependencies.setdefault(key, set()).add(value) for elt in key: if isinstance(elt, Key): self._add_dependencies(elt, value)
def _add_dependencies(self, key: Key, value: Key = None) -> None: if value is None: value = key else: self.dependencies.setdefault(key, set()).add(value) if isinstance(key, tuple): for elt in key: self._add_dependencies(elt, value)
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def update_from_options(self, frames: List[Frame]) -> bool: """Update the frame to reflect that each key will be updated as in one of the frames. Return whether any item changes. If a key is declared as AnyType, only update it if all the options are the same. """ frames = [f for f in frames i...
def update_from_options(self, frames: List[Frame]) -> bool: """Update the frame to reflect that each key will be updated as in one of the frames. Return whether any item changes. If a key is declared as AnyType, only update it if all the options are the same. """ changed = False keys = se...
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def pop_frame(self, can_skip: bool, fall_through: int) -> Frame: """Pop a frame and return it. See frame_context() for documentation of fall_through. """ if fall_through > 0: self.allow_jump(-fall_through) result = self.frames.pop() options = self.options_on_return.pop() if can_s...
def pop_frame(self, fall_through: int = 0) -> Frame: """Pop a frame and return it. See frame_context() for documentation of fall_through. """ if fall_through and not self.breaking_out: self.allow_jump(-fall_through) result = self.frames.pop() options = self.options_on_return.pop() ...
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def get_declaration(self, expr: Node) -> Type: if isinstance(expr, RefExpr) and isinstance(expr.node, Var): type = expr.node.type if isinstance(type, PartialType): return None return type else: return None
def get_declaration(self, node: Node) -> Type: if isinstance(node, (RefExpr, SymbolTableNode)) and isinstance(node.node, Var): type = node.node.type if isinstance(type, PartialType): return None return type else: return None
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def allow_jump(self, index: int) -> None: # self.frames and self.options_on_return have different lengths # so make sure the index is positive if index < 0: index += len(self.options_on_return) frame = Frame() for f in self.frames[index + 1 :]: frame.update(f) if f.unreachabl...
def allow_jump(self, index: int) -> None: # self.frames and self.options_on_return have different lengths # so make sure the index is positive if index < 0: index += len(self.options_on_return) frame = Frame() for f in self.frames[index + 1 :]: frame.update(f) self.options_on_ret...
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def frame_context( self, *, can_skip: bool, fall_through: int = 1, break_frame: int = 0, continue_frame: int = 0, try_frame: bool = False, ) -> Iterator[Frame]: """Return a context manager that pushes/pops frames on enter/exit. If can_skip is True, control flow is allowed to bypass ...
def frame_context(self, fall_through: int = 0) -> Iterator[Frame]: """Return a context manager that pushes/pops frames on enter/exit. If fall_through > 0, then it will allow the frame to escape to its ancestor `fall_through` levels higher. A simple 'with binder.frame_context(): pass' will change the ...
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def visit_file(self, file_node: MypyFile, path: str, options: Options) -> None: """Type check a mypy file with the given path.""" self.options = options self.pass_num = 0 self.is_stub = file_node.is_stub self.errors.set_file(path) self.globals = file_node.names self.enter_partial_types() ...
def visit_file(self, file_node: MypyFile, path: str, options: Options) -> None: """Type check a mypy file with the given path.""" self.options = options self.pass_num = 0 self.is_stub = file_node.is_stub self.errors.set_file(path) self.globals = file_node.names self.enter_partial_types() ...
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def accept_loop( self, body: Statement, else_body: Statement = None, *, exit_condition: Expression = None, ) -> Type: """Repeatedly type check a loop body until the frame doesn't change. If exit_condition is set, assume it must be False on exit from the loop. Then check the else_body. ...
def accept_loop(self, body: Union[IfStmt, Block], else_body: Block = None) -> Type: """Repeatedly type check a loop body until the frame doesn't change. Then check the else_body. """ # The outer frame accumulates the results of all iterations with self.binder.frame_context(1) as outer_frame: ...
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def check_func_def(self, defn: FuncItem, typ: CallableType, name: str) -> None: """Type check a function definition.""" # Expand type variables with value restrictions to ordinary types. for item, typ in self.expand_typevars(defn, typ): old_binder = self.binder self.binder = ConditionalTypeB...
def check_func_def(self, defn: FuncItem, typ: CallableType, name: str) -> None: """Type check a function definition.""" # Expand type variables with value restrictions to ordinary types. for item, typ in self.expand_typevars(defn, typ): old_binder = self.binder self.binder = ConditionalTypeB...
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def visit_class_def(self, defn: ClassDef) -> Type: """Type check a class definition.""" typ = defn.info self.errors.push_type(defn.name) self.enter_partial_types() old_binder = self.binder self.binder = ConditionalTypeBinder() with self.binder.top_frame_context(): self.accept(defn.de...
def visit_class_def(self, defn: ClassDef) -> Type: """Type check a class definition.""" typ = defn.info self.errors.push_type(defn.name) self.enter_partial_types() old_binder = self.binder self.binder = ConditionalTypeBinder() with self.binder.frame_context(): self.accept(defn.defs) ...
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def visit_block(self, b: Block) -> Type: if b.is_unreachable: return None for s in b.body: if self.binder.is_unreachable(): break self.accept(s)
def visit_block(self, b: Block) -> Type: if b.is_unreachable: return None for s in b.body: self.accept(s) if self.binder.breaking_out: break
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def visit_return_stmt(self, s: ReturnStmt) -> Type: """Type check a return statement.""" self.check_return_stmt(s) self.binder.unreachable()
def visit_return_stmt(self, s: ReturnStmt) -> Type: """Type check a return statement.""" self.binder.breaking_out = True if self.is_within_function(): defn = self.function_stack[-1] if defn.is_generator: return_type = self.get_generator_return_type( self.return_ty...
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def visit_if_stmt(self, s: IfStmt) -> Type: """Type check an if statement.""" # This frame records the knowledge from previous if/elif clauses not being taken. # Fall-through to the original frame is handled explicitly in each block. with self.binder.frame_context(can_skip=False, fall_through=0): ...
def visit_if_stmt(self, s: IfStmt) -> Type: """Type check an if statement.""" breaking_out = True # This frame records the knowledge from previous if/elif clauses not being taken. with self.binder.frame_context(): for e, b in zip(s.expr, s.body): t = self.accept(e) self.c...
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def visit_while_stmt(self, s: WhileStmt) -> Type: """Type check a while statement.""" self.accept_loop( IfStmt([s.expr], [s.body], None), s.else_body, exit_condition=s.expr )
def visit_while_stmt(self, s: WhileStmt) -> Type: """Type check a while statement.""" self.accept_loop(IfStmt([s.expr], [s.body], None), s.else_body)
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def visit_assert_stmt(self, s: AssertStmt) -> Type: self.accept(s.expr) # If this is asserting some isinstance check, bind that type in the following code true_map, _ = self.find_isinstance_check(s.expr) self.push_type_map(true_map)
def visit_assert_stmt(self, s: AssertStmt) -> Type: self.accept(s.expr) # If this is asserting some isinstance check, bind that type in the following code true_map, _ = find_isinstance_check(s.expr, self.type_map) if true_map: for var, type in true_map.items(): self.binder.push(var...
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def visit_raise_stmt(self, s: RaiseStmt) -> Type: """Type check a raise statement.""" if s.expr: self.type_check_raise(s.expr, s) if s.from_expr: self.type_check_raise(s.from_expr, s) self.binder.unreachable()
def visit_raise_stmt(self, s: RaiseStmt) -> Type: """Type check a raise statement.""" self.binder.breaking_out = True if s.expr: self.type_check_raise(s.expr, s) if s.from_expr: self.type_check_raise(s.from_expr, s)
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def visit_try_stmt(self, s: TryStmt) -> Type: """Type check a try statement.""" # Our enclosing frame will get the result if the try/except falls through. # This one gets all possible states after the try block exited abnormally # (by exception, return, break, etc.) with self.binder.frame_context(ca...
def visit_try_stmt(self, s: TryStmt) -> Type: """Type check a try statement.""" # Our enclosing frame will get the result if the try/except falls through. # This one gets all possible intermediate states with self.binder.frame_context(): if s.finally_body: self.binder.try_frames.add(...
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def visit_try_without_finally(self, s: TryStmt, try_frame: bool) -> None: """Type check a try statement, ignoring the finally block. On entry, the top frame should receive all flow that exits the try block abnormally (i.e., such that the else block does not execute), and its parent should receive all f...
def visit_try_without_finally(self, s: TryStmt) -> bool: """Type check a try statement, ignoring the finally block. Return whether we are guaranteed to be breaking out. Otherwise, it will place the results possible frames of that don't break out into self.binder.frames[-2]. """ breaking_out = T...
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def visit_break_stmt(self, s: BreakStmt) -> Type: self.binder.handle_break() return None
def visit_break_stmt(self, s: BreakStmt) -> Type: self.binder.breaking_out = True self.binder.allow_jump(self.binder.loop_frames[-1] - 1) return None
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def visit_continue_stmt(self, s: ContinueStmt) -> Type: self.binder.handle_continue() return None
def visit_continue_stmt(self, s: ContinueStmt) -> Type: self.binder.breaking_out = True self.binder.allow_jump(self.binder.loop_frames[-1]) return None
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def find_isinstance_check( self, n: Expression ) -> Tuple[Optional[Dict[Expression, Type]], Optional[Dict[Expression, Type]]]: return find_isinstance_check(n, self.type_map)
def find_isinstance_check( node: Expression, type_map: Dict[Expression, Type], ) -> Tuple[TypeMap, TypeMap]: """Find any isinstance checks (within a chain of ands). Includes implicit and explicit checks for None. Return value is a map of variables to their types if the condition is true and a ...
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def check_boolean_op(self, e: OpExpr, context: Context) -> Type: """Type check a boolean operation ('and' or 'or').""" # A boolean operation can evaluate to either of the operands. # We use the current type context to guide the type inference of of # the left operand. We also use the left operand type...
def check_boolean_op(self, e: OpExpr, context: Context) -> Type: """Type check a boolean operation ('and' or 'or').""" # A boolean operation can evaluate to either of the operands. # We use the current type context to guide the type inference of of # the left operand. We also use the left operand type...
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError
def check_generator_or_comprehension( self, gen: GeneratorExpr, type_name: str, id_for_messages: str ) -> Type: """Type check a generator expression or a list comprehension.""" with self.chk.binder.frame_context(can_skip=True, fall_through=0): self.check_for_comp(gen) # Infer the type of th...
def check_generator_or_comprehension( self, gen: GeneratorExpr, type_name: str, id_for_messages: str ) -> Type: """Type check a generator expression or a list comprehension.""" with self.chk.binder.frame_context(): self.check_for_comp(gen) # Infer the type of the list comprehension by using...
https://github.com/python/mypy/issues/1289
Traceback (most recent call last): File "./scripts/mypy", line 6, in <module> main(__file__) File "mypy/mypy/main.py", line 50, in main type_check_only(sources, bin_dir, options) File "mypy/mypy/main.py", line 94, in type_check_only python_path=options.python_path) File "mypy/mypy/build.py", line 210, in build result =...
AttributeError