MCPcopy Index your code
hub / github.com/ipython/ipython / enum_factory

Function enum_factory

IPython/external/qt_loaders.py:413–423  ·  view source on GitHub ↗

Construct an enum helper to account for PyQt5 <-> PyQt6 changes.

(QT_API, QtCore)

Source from the content-addressed store, hash-verified

411
412
413def enum_factory(QT_API, QtCore):
414 """Construct an enum helper to account for PyQt5 <-> PyQt6 changes."""
415
416 @lru_cache(None)
417 def _enum(name):
418 # foo.bar.Enum.Entry (PyQt6) <=> foo.bar.Entry (non-PyQt6).
419 return operator.attrgetter(
420 name if QT_API == QT_API_PYQT6 else name.rpartition(".")[0]
421 )(sys.modules[QtCore.__package__])
422
423 return _enum

Callers 1

qt_for_kernel.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…