-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Support for string literal references #86
Comments
Hello, thanks for the feature request 🙂 Of course circular imports must be avoided, I completely understand the need for stringified annotations. One thing you could try though, is to use
If
Maybe we could only support explicit uses of Happy to get your thoughts on this |
Thanks for your feedback 🙂 The issue with your idea is that... we don't use Well, I tried to list "all the different situations" and all I can think about is:
...so it might not be that hard! Can you see any other example where a string without |
We use this simple transformer to process annotations in pydoctor: https://github.com/twisted/pydoctor/blob/19e29766d4ad5b8226fe7cb4103776ba508b9c66/pydoctor/astbuilder.py#L1015 |
Thank you @tristanlatr 🙂 |
Thanks for supporting this. Just installed the latest version and it works like a charm! 🎉 |
Is your feature request related to a problem? Please describe.
Currently, string literal typing (
x: "MyClass"
instead ofx: MyClass
) does not generate reference links in the docs, as can be seen here:I have not found any information about this in your planned features, apologies if this is already planned / known.
Describe the solution you'd like
It would be very nice if griffe would parse those and generate reference links.
Describe alternatives you've considered
One could stop using string literal typing, but that is not always feasible because of circular imports, etc.
The text was updated successfully, but these errors were encountered: