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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot parse code with "match / case" #79
Comments
Hi @rabernat, thanks for raising this issue! Unfortunately I won't have time to look into this in the short term, but I'd be happy to accept a PR if you're up for it. |
Side note: I'm not sure if lib2to3 was updated to support match/case. |
Looks like https://docs.python.org/3.11/library/2to3.html#module-lib2to3 These packages are recommended as alternatives: I'm taking a look at it now as I just ran into this issue and getting rid of |
@rabernat @NiklasRosenstein This passes the https://github.com/nrser/docspec/tree/blib2to3 It's a single commit: It seems the black folks have their own fork/extension of I added |
Just a heads up, tried that code on source from an actual project and there are a bunch of issues. Looks like relatively minor stuff involving the AST being slightly different, but it's gonna take some time to grind through. |
Thanks for maintaining this fantastic project! 馃檹 We are using it to integrate our python API docs with a Docusaurus site.
Describe the bug
Python 3.10 introduced structural pattern matching with
match
/case
syntax. I have found that mydoc markdown cannot parse code with this syntax. I am filing the bug report here rather than in pydoc-markdown because the stack trace indicates that the error comes fromdocspec_python
To Reproduce
Steps to reproduce the behavior:
Create the following python module
Create a pydoc-markdown configuration to parse it. Mine looks like this
Then run
pydoc-markdown
. My stack trace looks like thisExpected behavior
Given that docspec-python supports Python >=3.7, I would expect it to be able to parse all valid python 3.10 syntax.
Versions
pydoc-markdown, version 4.6.3
docspec-python, version 2.0.2
The text was updated successfully, but these errors were encountered: