Conversation
…at runtime when its imported from within `if TYPE_CHECKING: ...`
There was a problem hiding this comment.
is typing_extensions a dev dependency because they are used in tests? I would try to take steps to ensure that it's never used within src code, perhaps configure ruffs TID251 rule?
edit:
oh, ermmmm idk how I feel about type importing something that isn't a dependency when it could be, seems a bit sus imo
|
in theory (and in typing stubs), |
|
numpy uses this "trick" quite a lot btw |
|
oh and |
|
up to you, I would just include it but w/e not sure how you would ensure that it's never imported for real in |
My hope is that either ruff or basedpyright will catch it. |
fixes #46
Instead of returning an over-engineered function wrapper, I decided to follow the advice of @KotlinIsland and simply return the original function directly, as the result of the main function doesn't matter anyway.
As a consequence of the cleaner code, the
typing_extensionsdependency isn't needed anymore, so I removed it from the required dependencies forpython < 3.11.