This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Example for creating classes with attrs that contain lazy-loaded fields. | |
""" | |
import attr | |
_lazy_fields_container_name = "_lazy_fields" | |
_lazy_field_metadata_key = "lazy" | |
_lazy_loader_function_prefix = "lazy_loader__" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from contextlib import contextmanager | |
@contextmanager | |
def hide_traceback() -> None: | |
def is_running_from_ipython() -> bool: | |
""" Checks whether running in IPython interactive console or not """ | |
try: | |
import IPython | |
except ImportError: |