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

Document that the Dict, List and Set trait types copy on assignment #1402

Merged
merged 2 commits into from
Jan 20, 2021

Conversation

aaronayres35
Copy link
Contributor

closes #1226

This PR adds a statement to the docstrings of Dict, List, and Set mentioning that they copy values on assignment. It also adds very brief clarifying examples like the ones mentioned on the issue, although those may be overkill for the docstring. I convinced myself they were useful additions, but if a reviewer disagrees I am happy to remove them.

Also, this content would better be detailed (or should additionally be detailed) somewhere in the used manual. As mentioned on the issue though, we currently don't have good sections on collection types. There should be a separate issue for adding those sections if there isn't one already opened (I will check shortly).

Checklist

  • [ ] Tests
  • [ ] Update API reference (docs/source/traits_api_reference)
  • Update User manual (docs/source/traits_user_manual)
  • [ ] Update type annotation hints in traits-stubs

traits/trait_types.py Outdated Show resolved Hide resolved
Copy link
Member

@mdickinson mdickinson left a comment

Choose a reason for hiding this comment

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

LGTM. I took the liberty of fixing a copy-and-paste typo before merging.

@mdickinson
Copy link
Member

There should be a separate issue for adding those sections if there isn't one already opened (I will check shortly).

I think #1403 covers this.

@mdickinson
Copy link
Member

I think #1403 covers this.

D'oh! Of course it does, because that's the issue you opened after checking there wasn't already one. Sorry, and thank you!

@mdickinson mdickinson merged commit 0a65b76 into master Jan 20, 2021
@mdickinson mdickinson deleted the collection-trait-type-docstrings branch January 20, 2021 09:36
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 that the Dict, List and Set trait types copy on assignment
2 participants