Skip to content

Allow user to specify whether TYPE_CHECKING should be true or not #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lihu-zhong opened this issue Nov 14, 2018 · 3 comments
Closed

Comments

@lihu-zhong
Copy link
Contributor

A recent commit 86d0834 sets TYPE_CHECKING to True unconditionally, which breaks a workaround I had been using for a bug in typing. Essentially, it works like this:

if TYPE_CHECKING:
    class MyType:
        """This is the actual class I need, but it falls over at runtime due to a bug"""
        ...
else:
    class MyType:
        """This is a dummy class"""
        ...

You can see the full thread here: python/typing#561 (comment)

Please make this variable user-configurable; I can't build my docs with this change. Thank you!

@agronholm
Copy link
Collaborator

I'm going to have to find out how to add configuration options to a Sphinx plugin.

@agronholm
Copy link
Collaborator

Fixed via 2afccd3, v1.5.0 released.

@lihu-zhong
Copy link
Contributor Author

Thank you for the fast turn around!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants