MCPcopy Index your code
hub / github.com/python/mypy / copy_modified

Method copy_modified

mypy/types.py:1309–1328  ·  view source on GitHub ↗
(
        self,
        # Mark with Bogus because _dummy is just an object (with type Any)
        type_of_any: int = _dummy_int,
        original_any: Bogus[AnyType | None] = _dummy,
        missing_import_name: Bogus[str | None] = _dummy,
    )

Source from the content-addressed store, hash-verified

1307 return visitor.visit_any(self)
1308
1309 def copy_modified(
1310 self,
1311 # Mark with Bogus because _dummy is just an object (with type Any)
1312 type_of_any: int = _dummy_int,
1313 original_any: Bogus[AnyType | None] = _dummy,
1314 missing_import_name: Bogus[str | None] = _dummy,
1315 ) -> AnyType:
1316 if type_of_any == _dummy_int:
1317 type_of_any = self.type_of_any
1318 if original_any is _dummy:
1319 original_any = self.source_any
1320 if missing_import_name is _dummy:
1321 missing_import_name = self.missing_import_name
1322 return AnyType(
1323 type_of_any=type_of_any,
1324 source_any=original_any,
1325 missing_import_name=missing_import_name,
1326 line=self.line,
1327 column=self.column,
1328 )
1329
1330 def __hash__(self) -> int:
1331 return hash(AnyType)

Callers 15

check_func_itemMethod · 0.45
visit_decorator_innerMethod · 0.45
expand_callable_variantsFunction · 0.45
detach_callableFunction · 0.45
visit_type_alias_typeMethod · 0.45
erased_varsFunction · 0.45

Calls 1

AnyTypeClass · 0.85

Tested by 2

my_hookFunction · 0.36