Skip to content
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

Nested classes with annotation feature #440

Closed
Dliwk opened this issue Sep 25, 2022 · 1 comment
Closed

Nested classes with annotation feature #440

Dliwk opened this issue Sep 25, 2022 · 1 comment
Labels

Comments

@Dliwk
Copy link
Contributor

Dliwk commented Sep 25, 2022

Problem Description

Seems like pdoc can't handle references to nested class when annotations feature is enabled.

Steps to reproduce the behavior:

from __future__ import annotations

class Foo:
    class Bar:
        pass

    def __init__(self, bar: Bar):
        self.bar = bar
  1. pdoc module.py
  2. Warn: Error parsing type annotation Bar for module.Foo.__init__. Import of Bar failed: name 'Bar' is not defined

System Information

pdoc: 12.2.0
Python: 3.10.5
Platform: Linux-5.18.13-200.fc36.x86_64-x86_64-with-glibc2.35

@Dliwk Dliwk added the bug label Sep 25, 2022
mhils added a commit to mhils/pdoc that referenced this issue Sep 25, 2022
@mhils
Copy link
Member

mhils commented Sep 25, 2022

Thanks for the concise description! Fixed in #441.

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

No branches or pull requests

2 participants