Due to the way pickling works in python 3, we need to make sure the box config is created as early as possible.
(cls, *args: Any, **kwargs: Any)
| 358 | cls._box_resolved_defaults = {**getattr(cls, "_box_resolved_defaults", {}), **own} |
| 359 | |
| 360 | def __new__(cls, *args: Any, **kwargs: Any): |
| 361 | """ |
| 362 | Due to the way pickling works in python 3, we need to make sure |
| 363 | the box config is created as early as possible. |
| 364 | """ |
| 365 | config = _build_box_config(cls, kwargs) |
| 366 | obj = super().__new__(cls, *args, **kwargs) |
| 367 | obj._box_config = config |
| 368 | # Pickle reconstructs via __new__ + item assignment + __setstate__. |
| 369 | # Item assignment happens first, while this Box still has default options, |
| 370 | # so nested Box/BoxList values must be stored as-is (see __convert_and_store). |
| 371 | obj._box_config["__unpickling"] = True |
| 372 | return obj |
| 373 | |
| 374 | def __init__(self, *args: Any, **kwargs: Any): |
| 375 | super().__init__() |
nothing calls this directly
no test coverage detected