-
Notifications
You must be signed in to change notification settings - Fork 56
Better property support #640
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
Open
tristanlatr
wants to merge
64
commits into
master
Choose a base branch
from
587-better-property-support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
bd7ca7b
Initial attempt at fixing #587: Unify properties getter, setters and …
tristanlatr 5758a37
More property demo
tristanlatr eb8f49e
Fix test
tristanlatr 51935e6
Better understanding properties
tristanlatr 11ac561
fix test
tristanlatr 4c812ac
More tests
tristanlatr 6935be1
Don't use list() to create a list of attribute to initiate.
tristanlatr 32554af
Better checks before adding new inherited elements to property
tristanlatr b3c6d01
Add overriden properties to the RST demo.
tristanlatr 643069a
Merge branch 'master' into 587-better-property-support
tristanlatr 4fb19c2
fix import
tristanlatr a3f2519
add assert
tristanlatr 96fd437
Merge branch 'master' into 587-better-property-support
tristanlatr bdd449f
fix mypy
tristanlatr 67ec358
simplify the code a little bit
tristanlatr dbf0477
simplify again
tristanlatr e7c73a5
Simplify again, no need to tell the users the property is read-write …
tristanlatr d084224
Simplify more
tristanlatr 111b669
remove commented code
tristanlatr 991d0a4
Try to simplify more
tristanlatr b6ab83d
Refactors
tristanlatr 6cbb8a8
Merge branch 'master' into 587-better-property-support
tristanlatr d058d43
Merge branch 'master' into 587-better-property-support
tristanlatr d3d5d51
Simplify
tristanlatr 346b40d
Use impossible import cycle in test
tristanlatr 063ded2
Minor refactor
tristanlatr 9dccd4f
Minor refactors
tristanlatr 49eca75
Merge branch 'master' into 587-better-property-support
tristanlatr a1529ee
Fix import
tristanlatr 6203a04
Fix mypy
tristanlatr 272e7db
Fix crash :/
tristanlatr 88cb433
Fix pyflakes
tristanlatr 5acd371
Create a legit model object for Properties.
tristanlatr ceacac0
Refoctors to have a more simple model.
tristanlatr 91c34bf
Minor comment
tristanlatr a45ebe2
Add Property model to the extension system.
tristanlatr ff6a662
Simplify implementation
tristanlatr 2532a06
Simplify propertyInfo renderer
tristanlatr f2632a7
add missing PropertyMixin to mixinT
tristanlatr 4383240
Refacfors
tristanlatr 21a047a
Update docs/epytext_demo/demo_epytext_module.py
tristanlatr 4f6b591
Update docs/restructuredtext_demo/demo_restructuredtext_module.py
tristanlatr 91afd5b
Merge branch '587-better-property-support' of github.com:twisted/pydo…
tristanlatr 3eed08a
Merge branch 'master' into 587-better-property-support
tristanlatr de67845
Remove inherited property support. Add support for old school property()
tristanlatr 4b8a0ff
Avoid calling 'signature(property)', it fails on some python versions.
tristanlatr c635451
Trigger warnings when a docstring is beeing overriden.
tristanlatr 198f91d
Fix mypy and few refactors
tristanlatr d2e143b
Typo
tristanlatr 4e174e2
Merge branch 'master' into 587-better-property-support
tristanlatr 917947a
Merge branch 'master' into 587-better-property-support
tristanlatr ef4c7c0
Merge branch 'master' into 587-better-property-support
tristanlatr e6b9bef
Merge branch 'master' into 587-better-property-support
tristanlatr bd73b7e
Merge branch 'master' into 587-better-property-support
tristanlatr ac52177
Merge branch 'master' into 587-better-property-support
tristanlatr d7bdff5
Re-add support for inherited property support.
tristanlatr 5f2f3ee
Merge branch 'master' into 587-better-property-support
tristanlatr af08b4b
Fix pyflakes
tristanlatr f088646
Merge branch '587-better-property-support' of github.com:twisted/pydo…
tristanlatr 58c941b
Minor refactors
tristanlatr 1bb7bed
Make sure we don't remove property functions when the property is cre…
tristanlatr 238f386
Merge branch 'master' into 587-better-property-support
tristanlatr dec3483
Factor out some logic of the function def handler that is becoming to…
tristanlatr 323e59d
Merge branch 'master' into 587-better-property-support
tristanlatr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -153,13 +153,14 @@ def read_and_write(self) -> int: | |||||
@read_and_write.setter | ||||||
def read_and_write(self, value: int) -> None: | ||||||
""" | ||||||
This is a docstring for setter. | ||||||
This is a docstring for setter. | ||||||
Their are usually not explicitely documented though. | ||||||
""" | ||||||
|
||||||
@property | ||||||
def read_and_write_delete(self) -> int: | ||||||
""" | ||||||
This is a read-write-delete property. | ||||||
This is the docstring of the property. | ||||||
""" | ||||||
return 1 | ||||||
|
||||||
|
@@ -174,6 +175,13 @@ def read_and_write_delete(self) -> None: | |||||
""" | ||||||
This is a docstring for deleter. | ||||||
""" | ||||||
|
||||||
@property | ||||||
def undoc_prop(self) -> bytes: | ||||||
"""This property has a docstring only on the setter.""" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
tristanlatr marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
@undoc_prop.setter | ||||||
def undoc_prop(self, p) -> None: # type:ignore | ||||||
... | ||||||
|
||||||
class IContact(zope.interface.Interface): | ||||||
""" | ||||||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.