Comments (2)
Another example, from the docs, but without annotation:
from griffe.dataclasses import Docstring, Function, Parameters, Parameter, ParameterKind
from griffe.docstrings.parsers import Parser, parse
function = Function(
"func",
parameters=Parameters(
Parameter("param1", annotation=None, kind=ParameterKind.positional_or_keyword), # I only changed this line
Parameter("param2", annotation="int", kind=ParameterKind.keyword_only),
),
)
text = """
Hello I'm a docstring!
Parameters:
param1: Description.
param2: Description.
"""
docstring = Docstring(text, lineno=1, parent=function)
parsed = parse(docstring, Parser.google)
from griffe.
Thanks for the report! This is fixed in master (will push and release soon).
from griffe.
Related Issues (20)
- How to use return type changed in decorator?
- Subprocess error when checking project with no tags
- AliasResolutionError when checking project
- False positive when object becomes alias to object of the same type HOT 1
- Finder: use importlib.util._find_spec? HOT 1
- Unhandled case of a walrus operator in the output part of a list comprehension HOT 1
- Make inheritance of members from the parent class configurable when inspecting HOT 1
- Griffe with scikit-build-core does not work in editable mode HOT 17
- Infinite recursion, while loading `numpy` modules HOT 9
- docs for compiled modules contain all attributes HOT 10
- KeyError: 'python3' HOT 5
- Handling modules with dots in name HOT 9
- Error parsing the following code in a `.pyi` file, where types are marked as strings HOT 2
- Regression in 0.28 HOT 6
- Duplicate entries when checking project
- Expression.full() errors if any Expressions inside it HOT 2
- Fails to recognize optional arguments in NamedTuple HOT 2
- griffe fails to unparse `ast.Call ` at `ast.NamedExpr` (containing an assignment expression) HOT 4
- numpy parser parameter table breaks if there is an empty line between parameters HOT 5
- understand and document `typing/typing_extensions.deprecated` HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from griffe.