-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
Getting exception with Python 3.9 and 0.9.2 #286
Comments
What's the exception? The traceback seems to be missing a line. |
Yes, sorry. Also updated traceback above:
|
Thanks. Upstream issue bpo-40296. If you want to have a look about fixing / special-casing this, welcome. Lines 1068 to 1077 in bec6307
|
Some more info. The object itself where pdoc crashed is a type alias: Try = Result[TSource, Exception] I.e So the object being checked for subclasses is |
Yeah, given the bpo bug, I guess if our |
Yes, that works but gives duplicates the Result type in the menu (to the left). The doc page itself gets the name (Try) right. Any docstring for Try as a variable is not picked up. Sub-classing fixes the problem with documenting the Try "alias", but will give a little runtime overhead because of the subclass e.g: class Try(Result[TSource, Exception]):
"""A result type where the failure case can only be a valid
exception.""" |
PEP-224 docstring for Looks related to #229 (comment). What other fix do you propose? |
Yes, this is the same as #229. We should document it as a type alias and not as a class. |
Was it expected that bpo 40296 would resolve this issue? I'm on Python 3.10.4, which I believe should include the fix, and I still get an error like this.
|
This is how it was special-cased in pydoc: python/cpython#30253. I guess we should do something similar for pdoc3. |
Expected Behavior
Should work with Python 3.9.
Actual Behavior
Getting exception:
Steps to Reproduce
Additional info
The text was updated successfully, but these errors were encountered: