You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using attrs to define a class, using the @default decorator is not possible.
Steps to Reproduce
test.py:
from attrs import define, field
@define
class X_decorator:
value: int = field()
@value.default
def _value_default(self) -> int:
return 3
@define
class X_no_decorator:
value: int = field(default=3)
Performing pip-run sphinx -- -m sphinx . build then creates the correct documentation for the class X_no_decorator, but fails to do so for the X_decorator one due to an error:
Expected result:
I would have expected that one gets the same result for both classes.
Version
Operating System: MacOS
Python: 3.9.18
sphinx-toolbox: 3.5.0
Installation source
pip
The text was updated successfully, but these errors were encountered:
This PR introduces a more elaborate, HTML based documentation. It uses `sphinx` and the `read-the-docs` theme and is automatically created when calling `convert_code_to_documentation`.
The following changes are made by this PR:
- Add explicit `CONTRIBUTORS.md` file.
- Change links in `README.md` such that they work in the html version
- Add `concepts` folder and stub files for introducing general concepts of BayBE.
- Adjust the docstrings of attributes: These now need to be in the line below the attribute, NOT in the class docstring!
- Debug functionality for code conversion via `--debug` flag
- Simplification of conversion script
- Fix inheritance, thus implementing #18775
- Functionality to include examples when creating the documentation
- Making the script fail when errors are encountered during the building of the documentation
- General fixing of broken links, typos and so on
The following aspects still need to be done and will be part of an upcoming PR:
- Fill concept pages with actual content
- Adjust the CONTRIBUTION.md and CONTRIBUTORS.md file
Note that there are some issues that we should still discuss about:
- What do we do with the defaults? This is bugged (sphinx-toolbox/sphinx-toolbox#146) and might require some workaround.
Related work items: #18775, #19312
Description
When using attrs to define a class, using the
@default
decorator is not possible.Steps to Reproduce
test.py:
conf.py:
index.rst:
Actual result:
Performing
pip-run sphinx -- -m sphinx . build
then creates the correct documentation for the classX_no_decorator
, but fails to do so for theX_decorator
one due to an error:Expected result:
I would have expected that one gets the same result for both classes.
Version
Installation source
pip
The text was updated successfully, but these errors were encountered: