id
int64
1
6.07M
name
stringlengths
1
295
code
stringlengths
12
426k
language
stringclasses
1 value
source_file
stringlengths
5
202
start_line
int64
1
158k
end_line
int64
1
158k
repo
dict
6,068,601
dataclass_tag_callback
def dataclass_tag_callback(ctx: ClassDefContext) -> None: """Record that we have a dataclass in the main semantic analysis pass. The later pass implemented by DataclassTransformer will use this to detect dataclasses in base classes. """ # The value is ignored, only the existence matters. ctx.cl...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/dataclasses.py
571
578
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,602
dataclass_class_maker_callback
def dataclass_class_maker_callback(ctx: ClassDefContext) -> bool: """Hooks into the class typechecking process to add support for dataclasses.""" transformer = DataclassTransformer(ctx) return transformer.transform()
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/dataclasses.py
581
584
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,603
_collect_field_args
def _collect_field_args( expr: Expression, ctx: ClassDefContext ) -> tuple[bool, dict[str, Expression]]: """Returns a tuple where the first value represents whether or not the expression is a call to dataclass.field and the second is a dictionary of the keyword arguments that field() was called with. ...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/dataclasses.py
587
615
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,604
__init__
def __init__(self, init_type: Type | None = None) -> None: self.init_type = init_type
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
84
85
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,605
__init__
def __init__( self, name: str, info: TypeInfo, has_default: bool, init: bool, kw_only: bool, converter: Converter | None, context: Context, init_type: Type | None, ) -> None: self.name = name self.info = info self.has_de...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
91
109
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,606
argument
def argument(self, ctx: mypy.plugin.ClassDefContext) -> Argument: """Return this attribute as an argument to __init__.""" assert self.init init_type: Type | None = None if self.converter: if self.converter.init_type: init_type = self.converter.init_type ...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
111
151
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,607
serialize
def serialize(self) -> JsonDict: """Serialize this object so it can be saved and restored.""" return { "name": self.name, "has_default": self.has_default, "init": self.init, "kw_only": self.kw_only, "has_converter": self.converter is not None, ...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
153
167
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,608
deserialize
def deserialize( cls, info: TypeInfo, data: JsonDict, api: SemanticAnalyzerPluginInterface ) -> Attribute: """Return the Attribute that was serialized.""" raw_init_type = data["init_type"] init_type = deserialize_and_fixup_type(raw_init_type, api) if raw_init_type else None r...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
170
192
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,609
expand_typevar_from_subtype
def expand_typevar_from_subtype(self, sub_type: TypeInfo) -> None: """Expands type vars in the context of a subtype when an attribute is inherited from a generic super type.""" if self.init_type: self.init_type = map_type_from_supertype(self.init_type, sub_type, self.info) el...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
194
200
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,610
_determine_eq_order
def _determine_eq_order(ctx: mypy.plugin.ClassDefContext) -> bool: """ Validate the combination of *cmp*, *eq*, and *order*. Derive the effective value of order. """ cmp = _get_decorator_optional_bool_argument(ctx, "cmp") eq = _get_decorator_optional_bool_argument(ctx, "eq") order = _get_dec...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
203
229
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,611
_get_decorator_optional_bool_argument
def _get_decorator_optional_bool_argument( ctx: mypy.plugin.ClassDefContext, name: str, default: bool | None = None ) -> bool | None: """Return the Optional[bool] argument for the decorator. This handles both @decorator(...) and @decorator. """ if isinstance(ctx.reason, CallExpr): attr_valu...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
232
253
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,612
attr_tag_callback
def attr_tag_callback(ctx: mypy.plugin.ClassDefContext) -> None: """Record that we have an attrs class in the main semantic analysis pass. The later pass implemented by attr_class_maker_callback will use this to detect attrs lasses in base classes. """ # The value is ignored, only the existence mat...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
256
263
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,613
attr_class_maker_callback
def attr_class_maker_callback( ctx: mypy.plugin.ClassDefContext, auto_attribs_default: bool | None = False, frozen_default: bool = False, ) -> bool: """Add necessary dunder methods to classes decorated with attr.s. attrs is a package that lets you define classes without writing dull boilerplate cod...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
266
334
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,614
_get_frozen
def _get_frozen(ctx: mypy.plugin.ClassDefContext, frozen_default: bool) -> bool: """Return whether this class is frozen.""" if _get_decorator_bool_argument(ctx, "frozen", frozen_default): return True # Subclasses of frozen classes are frozen so check that. for super_info in ctx.cls.info.mro[1:-1...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
337
345
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,615
_analyze_class
def _analyze_class( ctx: mypy.plugin.ClassDefContext, auto_attribs: bool | None, kw_only: bool ) -> list[Attribute]: """Analyze the class body of an attr maker, its parents, and return the Attributes found. auto_attribs=True means we'll generate attributes from type annotations also. auto_attribs=None ...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
348
424
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,616
_add_empty_metadata
def _add_empty_metadata(info: TypeInfo) -> None: """Add empty metadata to mark that we've finished processing this class.""" info.metadata["attrs"] = {"attributes": [], "frozen": False}
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
427
429
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,617
_detect_auto_attribs
def _detect_auto_attribs(ctx: mypy.plugin.ClassDefContext) -> bool: """Return whether auto_attribs should be enabled or disabled. It's disabled if there are any unannotated attribs() """ for stmt in ctx.cls.defs.body: if isinstance(stmt, AssignmentStmt): for lvalue in stmt.lvalues: ...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
432
458
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,618
_attributes_from_assignment
def _attributes_from_assignment( ctx: mypy.plugin.ClassDefContext, stmt: AssignmentStmt, auto_attribs: bool, kw_only: bool ) -> Iterable[Attribute]: """Return Attribute objects that are created by this assignment. The assignments can look like this: x = attr.ib() x = y = attr.ib() x...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
461
493
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,619
_cleanup_decorator
def _cleanup_decorator(stmt: Decorator, attr_map: dict[str, Attribute]) -> None: """Handle decorators in class bodies. `x.default` will set a default value on x `x.validator` and `x.default` will get removed to avoid throwing a type error. """ remove_me = [] for func_decorator in stmt.decorator...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
496
524
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,620
_attribute_from_auto_attrib
def _attribute_from_auto_attrib( ctx: mypy.plugin.ClassDefContext, kw_only: bool, lhs: NameExpr, rvalue: Expression, stmt: AssignmentStmt, ) -> Attribute: """Return an Attribute for a new type assignment.""" name = unmangle(lhs.name) # `x: int` (without equal sign) assigns rvalue to Temp...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
527
540
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,621
_attribute_from_attrib_maker
def _attribute_from_attrib_maker( ctx: mypy.plugin.ClassDefContext, auto_attribs: bool, kw_only: bool, lhs: NameExpr, rvalue: CallExpr, stmt: AssignmentStmt, ) -> Attribute | None: """Return an Attribute from the assignment or None if you can't make one.""" if auto_attribs and not stmt.n...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
543
607
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,622
_parse_converter
def _parse_converter( ctx: mypy.plugin.ClassDefContext, converter_expr: Expression | None ) -> Converter | None: """Return the Converter object from an Expression.""" # TODO: Support complex converters, e.g. lambdas, calls, etc. if not converter_expr: return None converter_info = Converter()...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
610
685
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,623
is_valid_overloaded_converter
def is_valid_overloaded_converter(defn: OverloadedFuncDef) -> bool: return all( (not isinstance(item, Decorator) or isinstance(item.func.type, FunctionLike)) for item in defn.items )
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
688
692
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,624
_parse_assignments
def _parse_assignments( lvalue: Expression, stmt: AssignmentStmt ) -> tuple[list[NameExpr], list[Expression]]: """Convert a possibly complex assignment expression into lists of lvalues and rvalues.""" lvalues: list[NameExpr] = [] rvalues: list[Expression] = [] if isinstance(lvalue, (TupleExpr, ListE...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
695
709
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,625
_add_order
def _add_order(ctx: mypy.plugin.ClassDefContext, adder: MethodAdder) -> None: """Generate all the ordering methods for this class.""" bool_type = ctx.api.named_type("builtins.bool") object_type = ctx.api.named_type("builtins.object") # Make the types be: # AT = TypeVar('AT') # def __lt__(s...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
712
730
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,626
_make_frozen
def _make_frozen(ctx: mypy.plugin.ClassDefContext, attributes: list[Attribute]) -> None: """Turn all the attributes into properties to simulate frozen classes.""" for attribute in attributes: if attribute.name in ctx.cls.info.names: # This variable belongs to this class so we can modify it. ...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
733
748
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,627
_add_init
def _add_init( ctx: mypy.plugin.ClassDefContext, attributes: list[Attribute], adder: MethodAdder ) -> None: """Generate an __init__ method for the attributes and add it to the class.""" # Convert attributes to arguments with kw_only arguments at the end of # the argument list pos_args = [] kw_o...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
751
780
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,628
_add_attrs_magic_attribute
def _add_attrs_magic_attribute( ctx: mypy.plugin.ClassDefContext, attrs: list[tuple[str, Type | None]] ) -> None: any_type = AnyType(TypeOfAny.explicit) attributes_types: list[Type] = [ ctx.api.named_type_or_none("attr.Attribute", [attr_type or any_type]) or any_type for _, attr_type in attr...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
783
814
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,629
_add_slots
def _add_slots(ctx: mypy.plugin.ClassDefContext, attributes: list[Attribute]) -> None: # Unlike `@dataclasses.dataclass`, `__slots__` is rewritten here. ctx.cls.info.slots = {attr.name for attr in attributes}
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
817
819
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,630
_add_match_args
def _add_match_args(ctx: mypy.plugin.ClassDefContext, attributes: list[Attribute]) -> None: if ( "__match_args__" not in ctx.cls.info.names or ctx.cls.info.names["__match_args__"].plugin_generated ): str_type = ctx.api.named_type("builtins.str") match_args = TupleType( ...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
822
836
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,631
__init__
def __init__(self, ctx: mypy.plugin.ClassDefContext) -> None: self.ctx = ctx self.self_type = fill_typevars(ctx.cls.info)
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
847
849
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,632
add_method
def add_method( self, method_name: str, args: list[Argument], ret_type: Type, self_type: Type | None = None, tvd: TypeVarType | None = None, ) -> None: """Add a method: def <method_name>(self, <args>) -> <ret_type>): ... to info. self_type: The type t...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/attrs.py
851
865
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,633
_find_simplecdata_base_arg
def _find_simplecdata_base_arg( tp: Instance, api: mypy.plugin.CheckerPluginInterface ) -> ProperType | None: """Try to find a parametrized _SimpleCData in tp's bases and return its single type argument. None is returned if _SimpleCData appears nowhere in tp's (direct or indirect) bases. """ if tp....
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/ctypes.py
26
40
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,634
_autoconvertible_to_cdata
def _autoconvertible_to_cdata(tp: Type, api: mypy.plugin.CheckerPluginInterface) -> Type: """Get a type that is compatible with all types that can be implicitly converted to the given CData type. Examples: * c_int -> Union[c_int, int] * c_char_p -> Union[c_char_p, bytes, int, NoneType] * MyStru...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/ctypes.py
43
75
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,635
_autounboxed_cdata
def _autounboxed_cdata(tp: Type) -> ProperType: """Get the auto-unboxed version of a CData type, if applicable. For *direct* _SimpleCData subclasses, the only type argument of _SimpleCData in the bases list is returned. For all other CData types, including indirect _SimpleCData subclasses, tp is return...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/ctypes.py
78
98
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,636
_get_array_element_type
def _get_array_element_type(tp: Type) -> ProperType | None: """Get the element type of the Array type tp, or None if not specified.""" tp = get_proper_type(tp) if isinstance(tp, Instance): assert tp.type.fullname == "ctypes.Array" if len(tp.args) == 1: return get_proper_type(tp.a...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/ctypes.py
101
108
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,637
array_constructor_callback
def array_constructor_callback(ctx: mypy.plugin.FunctionContext) -> Type: """Callback to provide an accurate signature for the ctypes.Array constructor.""" # Extract the element type from the constructor's return type, i. e. the type of the array # being constructed. et = _get_array_element_type(ctx.def...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/ctypes.py
111
142
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,638
array_getitem_callback
def array_getitem_callback(ctx: mypy.plugin.MethodContext) -> Type: """Callback to provide an accurate return type for ctypes.Array.__getitem__.""" et = _get_array_element_type(ctx.type) if et is not None: unboxed = _autounboxed_cdata(et) assert ( len(ctx.arg_types) == 1 ...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/ctypes.py
145
162
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,639
array_setitem_callback
def array_setitem_callback(ctx: mypy.plugin.MethodSigContext) -> CallableType: """Callback to provide an accurate signature for ctypes.Array.__setitem__.""" et = _get_array_element_type(ctx.type) if et is not None: allowed = _autoconvertible_to_cdata(et, ctx.api) assert len(ctx.default_signa...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/ctypes.py
165
184
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,640
array_iter_callback
def array_iter_callback(ctx: mypy.plugin.MethodContext) -> Type: """Callback to provide an accurate return type for ctypes.Array.__iter__.""" et = _get_array_element_type(ctx.type) if et is not None: unboxed = _autounboxed_cdata(et) return ctx.api.named_generic_type("typing.Iterator", [unbox...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/ctypes.py
187
193
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,641
array_value_callback
def array_value_callback(ctx: mypy.plugin.AttributeContext) -> Type: """Callback to provide an accurate type for ctypes.Array.value.""" et = _get_array_element_type(ctx.type) if et is not None: types: list[Type] = [] for tp in flatten_nested_unions([et]): tp = get_proper_type(tp)...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/ctypes.py
196
216
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,642
array_raw_callback
def array_raw_callback(ctx: mypy.plugin.AttributeContext) -> Type: """Callback to provide an accurate type for ctypes.Array.raw.""" et = _get_array_element_type(ctx.type) if et is not None: types: list[Type] = [] for tp in flatten_nested_unions([et]): tp = get_proper_type(tp) ...
python
python-3.10.8.amd64/Lib/site-packages/mypy/plugins/ctypes.py
219
239
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,643
__init__
def __init__(self, result: BuildResult) -> None: """Initialize fine-grained build based on a batch build. Args: result: Result from the initialized build. The manager and graph will be taken over by this class. manager: State of the build (mutated by this cla...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
168
202
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,644
update
def update( self, changed_modules: list[tuple[str, str]], removed_modules: list[tuple[str, str]] ) -> list[str]: """Update previous build result by processing changed modules. Also propagate changes to other modules as needed, but only process those parts of other modules that are a...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
204
294
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,645
trigger
def trigger(self, target: str) -> list[str]: """Trigger a specific target explicitly. This is intended for use by the suggestions engine. """ self.manager.errors.reset() changed_modules = propagate_changes_using_dependencies( self.manager, self.graph, ...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
296
314
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,646
flush_cache
def flush_cache(self) -> None: """Flush AST cache. This needs to be called after each increment, or file changes won't be detected reliably. """ self.manager.ast_cache.clear()
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
316
322
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,647
update_one
def update_one( self, changed_modules: list[tuple[str, str]], initial_set: set[str], removed_set: set[str], blocking_error: str | None, ) -> tuple[list[tuple[str, str]], tuple[str, str], list[str] | None]: """Process a module from the list of changed modules. ...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
324
366
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,648
update_module
def update_module( self, module: str, path: str, force_removed: bool ) -> tuple[list[tuple[str, str]], tuple[str, str], list[str] | None]: """Update a single modified module. If the module contains imports of previously unseen modules, only process one of the new modules and return ...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
368
454
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,649
find_unloaded_deps
def find_unloaded_deps( manager: BuildManager, graph: dict[str, State], initial: Sequence[str] ) -> list[str]: """Find all the deps of the nodes in initial that haven't had their tree loaded. The key invariant here is that if a module is loaded, so are all of their dependencies. This means that when we...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
457
482
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,650
ensure_deps_loaded
def ensure_deps_loaded(module: str, deps: dict[str, set[str]], graph: dict[str, State]) -> None: """Ensure that the dependencies on a module are loaded. Dependencies are loaded into the 'deps' dictionary. This also requires loading dependencies from any parent modules, since dependencies will get stor...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
485
501
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,651
ensure_trees_loaded
def ensure_trees_loaded( manager: BuildManager, graph: dict[str, State], initial: Sequence[str] ) -> None: """Ensure that the modules in initial and their deps have loaded trees.""" to_process = find_unloaded_deps(manager, graph, initial) if to_process: if is_verbose(manager): manage...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
504
516
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,652
update_module_isolated
def update_module_isolated( module: str, path: str, manager: BuildManager, previous_modules: dict[str, str], graph: Graph, force_removed: bool, ) -> UpdateResult: """Build a new version of one changed module only. Don't propagate changes to elsewhere in the program. Raise CompileError o...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
546
661
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,653
restore
def restore(ids: list[str]) -> None: # For each of the modules in ids, restore that id's old # manager.modules and graphs entries. (Except for the original # module, this means deleting them.) for id in ids: if id == orig_module and orig_tree: manager.modules[...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
585
597
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,654
find_relative_leaf_module
def find_relative_leaf_module(modules: list[tuple[str, str]], graph: Graph) -> tuple[str, str]: """Find a module in a list that directly imports no other module in the list. If no such module exists, return the lexicographically first module from the list. Always return one of the items in the modules list...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
664
688
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,655
delete_module
def delete_module(module_id: str, path: str, graph: Graph, manager: BuildManager) -> None: manager.log_fine_grained(f"delete module {module_id!r}") # TODO: Remove deps for the module (this only affects memory use, not correctness) if module_id in graph: del graph[module_id] if module_id in manag...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
691
710
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,656
dedupe_modules
def dedupe_modules(modules: list[tuple[str, str]]) -> list[tuple[str, str]]: seen: set[str] = set() result = [] for id, path in modules: if id not in seen: seen.add(id) result.append((id, path)) return result
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
713
720
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,657
get_module_to_path_map
def get_module_to_path_map(graph: Graph) -> dict[str, str]: return {module: node.xpath for module, node in graph.items()}
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
723
724
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,658
get_sources
def get_sources( fscache: FileSystemCache, modules: dict[str, str], changed_modules: list[tuple[str, str]] ) -> list[BuildSource]: sources = [] for id, path in changed_modules: if fscache.isfile(path): sources.append(BuildSource(path, id, None)) return sources
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
727
734
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,659
calculate_active_triggers
def calculate_active_triggers( manager: BuildManager, old_snapshots: dict[str, dict[str, SnapshotItem]], new_modules: dict[str, MypyFile | None], ) -> set[str]: """Determine activated triggers by comparing old and new symbol tables. For example, if only the signature of function m.f is different in...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
737
782
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,660
replace_modules_with_new_variants
def replace_modules_with_new_variants( manager: BuildManager, graph: dict[str, State], old_modules: dict[str, MypyFile | None], new_modules: dict[str, MypyFile | None], ) -> None: """Replace modules with newly builds versions. Retain the identities of externally visible AST nodes in the old...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
785
806
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,661
propagate_changes_using_dependencies
def propagate_changes_using_dependencies( manager: BuildManager, graph: dict[str, State], deps: dict[str, set[str]], triggered: set[str], up_to_date_modules: set[str], targets_with_errors: set[str], processed_targets: list[str], ) -> list[tuple[str, str]]: """Transitively rechecks target...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
809
871
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,662
find_targets_recursive
def find_targets_recursive( manager: BuildManager, graph: Graph, triggers: set[str], deps: dict[str, set[str]], up_to_date_modules: set[str], ) -> tuple[dict[str, set[FineGrainedDeferredNode]], set[str], set[TypeInfo]]: """Find names of all targets that need to reprocessed, given some triggers. ...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
874
933
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,663
reprocess_nodes
def reprocess_nodes( manager: BuildManager, graph: dict[str, State], module_id: str, nodeset: set[FineGrainedDeferredNode], deps: dict[str, set[str]], processed_targets: list[str], ) -> set[str]: """Reprocess a set of nodes within a single module. Return fired triggers. """ if m...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
936
1,028
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,664
key
def key(node: FineGrainedDeferredNode) -> int: # Unlike modules which are sorted by name within SCC, # nodes within the same module are sorted by line number, because # this is how they are processed in normal mode. return node.node.line
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
957
961
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,665
find_symbol_tables_recursive
def find_symbol_tables_recursive(prefix: str, symbols: SymbolTable) -> dict[str, SymbolTable]: """Find all nested symbol tables. Args: prefix: Full name prefix (used for return value keys and to filter result so that cross references to other modules aren't included) symbols: Root s...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
1,031
1,047
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,666
update_deps
def update_deps( module_id: str, nodes: list[FineGrainedDeferredNode], graph: dict[str, State], deps: dict[str, set[str]], options: Options, ) -> None: for deferred in nodes: node = deferred.node type_map = graph[module_id].type_map() tree = graph[module_id].tree ...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
1,050
1,068
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,667
lookup_target
def lookup_target( manager: BuildManager, target: str ) -> tuple[list[FineGrainedDeferredNode], TypeInfo | None]: """Look up a target by fully-qualified name. The first item in the return tuple is a list of deferred nodes that needs to be reprocessed. If the target represents a TypeInfo corresponding ...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
1,071
1,146
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,668
not_found
def not_found() -> None: manager.log_fine_grained(f"Can't find matching target for {target} (stale dependency?)")
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
1,081
1,082
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,669
is_verbose
def is_verbose(manager: BuildManager) -> bool: return manager.options.verbosity >= 1 or DEBUG_FINE_GRAINED
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
1,149
1,150
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,670
target_from_node
def target_from_node(module: str, node: FuncDef | MypyFile | OverloadedFuncDef) -> str | None: """Return the target name corresponding to a deferred node. Args: module: Must be module id of the module that defines 'node' Returns the target name, or None if the node is not a valid target in the giv...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
1,153
1,171
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,671
refresh_suppressed_submodules
def refresh_suppressed_submodules( module: str, path: str | None, deps: dict[str, set[str]], graph: Graph, fscache: FileSystemCache, refresh_file: Callable[[str, str], list[str]], ) -> list[str] | None: """Look for submodules that are now suppressed in target package. If a submodule a.b...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/update.py
1,185
1,260
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,672
compare_symbol_table_snapshots
def compare_symbol_table_snapshots( name_prefix: str, snapshot1: dict[str, SnapshotItem], snapshot2: dict[str, SnapshotItem] ) -> set[str]: """Return names that are different in two snapshots of a symbol table. Only shallow (intra-module) differences are considered. References to things defined outside...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
111
151
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,673
snapshot_symbol_table
def snapshot_symbol_table(name_prefix: str, table: SymbolTable) -> dict[str, SnapshotItem]: """Create a snapshot description that represents the state of a symbol table. The snapshot has a representation based on nested tuples and dicts that makes it easy and fast to find differences. Only "shallow" s...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
154
202
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,674
snapshot_definition
def snapshot_definition(node: SymbolNode | None, common: tuple[object, ...]) -> tuple[object, ...]: """Create a snapshot description of a symbol table node. The representation is nested tuples and dicts. Only externally visible attributes are included. """ if isinstance(node, FuncBase): # T...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
205
273
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,675
snapshot_type
def snapshot_type(typ: Type) -> SnapshotItem: """Create a snapshot representation of a type using nested tuples.""" return typ.accept(SnapshotTypeVisitor())
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
276
278
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,676
snapshot_optional_type
def snapshot_optional_type(typ: Type | None) -> SnapshotItem | None: if typ: return snapshot_type(typ) else: return None
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
281
285
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,677
snapshot_types
def snapshot_types(types: Sequence[Type]) -> SnapshotItem: return tuple(snapshot_type(item) for item in types)
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
288
289
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,678
snapshot_simple_type
def snapshot_simple_type(typ: Type) -> SnapshotItem: return (type(typ).__name__,)
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
292
293
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,679
encode_optional_str
def encode_optional_str(s: str | None) -> str: if s is None: return "<None>" else: return s
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
296
300
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,680
visit_unbound_type
def visit_unbound_type(self, typ: UnboundType) -> SnapshotItem: return ( "UnboundType", typ.name, typ.optional, typ.empty_tuple_index, snapshot_types(typ.args), )
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
318
325
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,681
visit_any
def visit_any(self, typ: AnyType) -> SnapshotItem: return snapshot_simple_type(typ)
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
327
328
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,682
visit_none_type
def visit_none_type(self, typ: NoneType) -> SnapshotItem: return snapshot_simple_type(typ)
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
330
331
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,683
visit_uninhabited_type
def visit_uninhabited_type(self, typ: UninhabitedType) -> SnapshotItem: return snapshot_simple_type(typ)
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
333
334
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,684
visit_erased_type
def visit_erased_type(self, typ: ErasedType) -> SnapshotItem: return snapshot_simple_type(typ)
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
336
337
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,685
visit_deleted_type
def visit_deleted_type(self, typ: DeletedType) -> SnapshotItem: return snapshot_simple_type(typ)
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
339
340
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,686
visit_instance
def visit_instance(self, typ: Instance) -> SnapshotItem: return ( "Instance", encode_optional_str(typ.type.fullname), snapshot_types(typ.args), ("None",) if typ.last_known_value is None else snapshot_type(typ.last_known_value), )
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
342
348
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,687
visit_type_var
def visit_type_var(self, typ: TypeVarType) -> SnapshotItem: return ( "TypeVar", typ.name, typ.fullname, typ.id.raw_id, typ.id.meta_level, snapshot_types(typ.values), snapshot_type(typ.upper_bound), typ.variance, ...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
350
360
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,688
visit_param_spec
def visit_param_spec(self, typ: ParamSpecType) -> SnapshotItem: return ( "ParamSpec", typ.id.raw_id, typ.id.meta_level, typ.flavor, snapshot_type(typ.upper_bound), )
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
362
369
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,689
visit_type_var_tuple
def visit_type_var_tuple(self, typ: TypeVarTupleType) -> SnapshotItem: return ( "TypeVarTupleType", typ.id.raw_id, typ.id.meta_level, snapshot_type(typ.upper_bound), )
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
371
377
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,690
visit_unpack_type
def visit_unpack_type(self, typ: UnpackType) -> SnapshotItem: return ("UnpackType", snapshot_type(typ.type))
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
379
380
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,691
visit_parameters
def visit_parameters(self, typ: Parameters) -> SnapshotItem: return ( "Parameters", snapshot_types(typ.arg_types), tuple(encode_optional_str(name) for name in typ.arg_names), tuple(typ.arg_kinds), )
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
382
388
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,692
visit_callable_type
def visit_callable_type(self, typ: CallableType) -> SnapshotItem: # FIX generics return ( "CallableType", snapshot_types(typ.arg_types), snapshot_type(typ.ret_type), tuple(encode_optional_str(name) for name in typ.arg_names), tuple(typ.arg_kind...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
390
400
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,693
visit_tuple_type
def visit_tuple_type(self, typ: TupleType) -> SnapshotItem: return ("TupleType", snapshot_types(typ.items))
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
402
403
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,694
visit_typeddict_type
def visit_typeddict_type(self, typ: TypedDictType) -> SnapshotItem: items = tuple((key, snapshot_type(item_type)) for key, item_type in typ.items.items()) required = tuple(sorted(typ.required_keys)) return ("TypedDictType", items, required)
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
405
408
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,695
visit_literal_type
def visit_literal_type(self, typ: LiteralType) -> SnapshotItem: return ("LiteralType", snapshot_type(typ.fallback), typ.value)
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
410
411
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,696
visit_union_type
def visit_union_type(self, typ: UnionType) -> SnapshotItem: # Sort and remove duplicates so that we can use equality to test for # equivalent union type snapshots. items = {snapshot_type(item) for item in typ.items} normalized = tuple(sorted(items)) return ("UnionType", normalize...
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
413
418
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,697
visit_overloaded
def visit_overloaded(self, typ: Overloaded) -> SnapshotItem: return ("Overloaded", snapshot_types(typ.items))
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
420
421
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,698
visit_partial_type
def visit_partial_type(self, typ: PartialType) -> SnapshotItem: # A partial type is not fully defined, so the result is indeterminate. We shouldn't # get here. raise RuntimeError
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
423
426
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,699
visit_type_type
def visit_type_type(self, typ: TypeType) -> SnapshotItem: return ("TypeType", snapshot_type(typ.item))
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
428
429
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,068,700
visit_type_alias_type
def visit_type_alias_type(self, typ: TypeAliasType) -> SnapshotItem: assert typ.alias is not None return ("TypeAliasType", typ.alias.fullname, snapshot_types(typ.args))
python
python-3.10.8.amd64/Lib/site-packages/mypy/server/astdiff.py
431
433
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }