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

Function detect_undefined_bitmap

mypyc/analysis/attrdefined.py:417–437  ·  view source on GitHub ↗
(cl: ClassIR, seen: set[ClassIR])

Source from the content-addressed store, hash-verified

415
416
417def detect_undefined_bitmap(cl: ClassIR, seen: set[ClassIR]) -> None:
418 if cl.is_trait:
419 return
420
421 if cl in seen:
422 return
423 seen.add(cl)
424 for base in cl.base_mro[1:]:
425 detect_undefined_bitmap(base, seen)
426
427 if len(cl.base_mro) > 1:
428 cl.bitmap_attrs.extend(cl.base_mro[1].bitmap_attrs)
429 for n, t in cl.attributes.items():
430 if t.error_overlap and not cl.is_always_defined(n):
431 cl.bitmap_attrs.append(n)
432
433 for base in cl.mro[1:]:
434 if base.is_trait:
435 for n, t in base.attributes.items():
436 if t.error_overlap and not cl.is_always_defined(n) and n not in cl.bitmap_attrs:
437 cl.bitmap_attrs.append(n)

Callers 1

Calls 6

lenFunction · 0.85
extendMethod · 0.80
is_always_definedMethod · 0.80
appendMethod · 0.80
addMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…