| 1 |
============ |
| 2 |
Known Issues |
| 3 |
============ |
| 4 |
This document intends to record any known long-standing issues/limitations with Cyclopts. |
| 5 |
While this document should always be up to date, please also `visit the github-issues page <https://github.com/BrianPugh/cyclopts/issues>`_ for more information & discussion. |
| 6 |
|
| 7 |
``from __future__ import annotations`` |
| 8 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 9 |
|
| 10 |
Due to quirks in the python-typing system, Cyclopts can only support some scenarios surrounding `PEP-0563`_, the strinigization of type hints via ``from __future__ import annotations``. |
| 11 |
Notably, this can also sometimes break ``dataclass`` definitions when inheritance from multiple python modules is involved. |
| 12 |
Attempts have been made to improve Cyclopts support, but there are the following blockers: |
| 13 |
|
| 14 |
1. CPython has `some bugs <https://github.com/python/cpython/issues/89687>`_ around :func:`typing.get_type_hints`. It is outside the scope of Cyclopts to compensate for the complex task of type-hint scoping and resolution. |
| 15 |
|
| 16 |
2. Particularly with dataclasses, it looks like they will be fixing these bugs, but it would only be backported to `3.13 and 3.14 <https://github.com/python/cpython/issues/133956#issuecomment-2883646533>`_. |
| 17 |
This limitation to very modern python versions makes a lot of PEP-0563 moot. |
| 18 |
|
| 19 |
3. `PEP-0649`_ and `PEP-0749`_ deprecate the usage of ``from __future__ import annotations``. This suggests that it is not worth the long-term maintenance of supporting the complications of this feature. |
| 20 |
|
| 21 |
|
| 22 |
`Original discussion on GitHub. <https://github.com/BrianPugh/cyclopts/issues/439>`_ |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
.. _PEP-0563: https://peps.python.org/563 |
| 27 |
.. _PEP-0649: https://peps.python.org/649 |
| 28 |
.. _PEP-0749: https://peps.python.org/749 |