Skip to content

Document attr and attribute #1311

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

Merged
merged 9 commits into from
Apr 22, 2024
Merged

Document attr and attribute #1311

merged 9 commits into from
Apr 22, 2024

Conversation

kokoavailable
Copy link
Contributor

@kokoavailable kokoavailable commented Apr 18, 2024

Document attr and attribute. Closes #1308


📚 Documentation preview 📚: https://cpython-devguide--1311.org.readthedocs.build/documentation/markup/

@ghost
Copy link

ghost commented Apr 18, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@hugovk
Copy link
Member

hugovk commented Apr 18, 2024

First, of all, please could you sign the CLA?

@Mariatta
Copy link
Member

Can you mention the Issue number on the PR description (instead of in the title?)

E.g.

Closes #1308

@kokoavailable kokoavailable changed the title Document attr and attribute #1308 Document attr and attribute Apr 19, 2024
@kokoavailable
Copy link
Contributor Author

First, of all, please could you sign the CLA?

Done! Thank you.

@kokoavailable
Copy link
Contributor Author

Can you mention the Issue number on the PR description (instead of in the title?)

E.g.

Closes #1308

Done!!

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Let's compare "functions definitions" and "functions references" in the quick reference table:

image

Let's add "attribute definitions" and "attribute references" to the table. The attribute definition are already in the "Information units" section, and let's add the references to the "Roles" section.

kokoavailable and others added 4 commits April 21, 2024 15:12
[fix] commit suggestion

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
[fix] delete dup

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@kokoavailable kokoavailable requested a review from hugovk April 21, 2024 06:50
@hugovk
Copy link
Member

hugovk commented Apr 21, 2024

@python/organization-owners Please could you enable https://pre-commit.ci for this repo?

@kokoavailable
Copy link
Contributor Author

@python/organization-owners Please could you enable https://pre-commit.ci for this repo?

done!

@@ -24,6 +24,8 @@ variables/literals/code ````foo````, ````42````, ````len(s) - 1```` :ref:`inline
True/False/None ````True````, ````False````, ````None```` :ref:`inline-markup`
functions definitions ``.. function:: print(*args)`` :ref:`directives`
functions references ``:func:`print``` :ref:`roles`
attribute definitions ``.. attribute: `attr-name``` :ref:`directives`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
attribute definitions ``.. attribute: `attr-name``` :ref:`directives`
attribute definitions ``.. attribute: `attr-name``` :ref:`information-units`

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this should be added. In the table I used .. function:/:func: as an example, but the same applies for classes, methods, attributes and several other directives/roles pairs.

Perhaps a separate table associating directives with the roles that can be used to link to them would be better? (If this is done, it should be a separate PR.).

Comment on lines 570 to 571

Refer to an attribute, use the ``:attr:`` role::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Refer to an attribute, use the ``:attr:`` role::
Refer to an attribute using the ``:attr:`` role::

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this is useful here, the same could be done for other directives too, like the class just above or the method just below. It would be nice if the documentation was consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this is useful here, the same could be done for other directives too, like the class just above or the method just below. It would be nice if the documentation was consistent.

should it be seperate pr?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either way is fine, but smaller PRs are easier to review and merge.

Would you like to make a separate follow-up PR? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either way is fine, but smaller PRs are easier to review and merge.

Would you like to make a separate follow-up PR? :)

sure. and when will this pr be merged ? #1311

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do it now :)

Thank you for the PR!

kokoavailable and others added 2 commits April 22, 2024 01:40
information-units

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
, using

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@hugovk hugovk merged commit 84cb6f0 into python:main Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document attr and attribute
4 participants