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 persistency and equality #220

Merged
merged 6 commits into from Oct 26, 2020
Merged

Conversation

d-maurer
Copy link
Contributor

Documentation related to #218

Copy link
Member

@jensens jensens left a comment

Choose a reason for hiding this comment

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

I think this nails it. Maybe a short example, addressing the last paragraph would help to get it out of grey theory, like

>>> def function1():
...     class IMyInterface(Interface): 
...         pass
...     return IMyInterface
... 
>>> def function2():
...     class IMyInterface(Interface): 
...         pass
...     return IMyInterface == function1()
... 
>>> function2()
True

@d-maurer
Copy link
Contributor Author

I think this nails it. Maybe a short example, addressing the last paragraph would help to get it out of grey theory, like

@jensens I added an example. I did not use your example because it is very rare to compare interfaces directly in application code. Equality checks happen indirectly, for example inside alsoProvides (or when used as key in a dict as in your original problem observation). Therefore, I constructed an example involving alsoProvides.

@d-maurer d-maurer requested a review from jensens October 19, 2020 06:34
jensens
jensens previously approved these changes Oct 19, 2020
Copy link
Member

@jensens jensens left a comment

Choose a reason for hiding this comment

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

Technical this explains the special behaviour well. That said, since I am not good enough in English to correct any grammar or alike.

Copy link
Member

@jamadden jamadden 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 for this!

I'm a +0 on it.

On the entirely positive side, I appreciate the explanation for some of the motivation for the comparison and hashing behaviour.

On the 0 side, I feel like the example of the possible hazards for the unwary, would be better made a part of the existing documentation for this behaviour, where there's already one such example. This is especially the case because the example doesn't actually work with persistence.

I'm happy to prepare a PR like that, incorporating the motivation and new example from this PR.

I'm not unhappy enough to ask that this one not be merged.

docs/README.rst Outdated Show resolved Hide resolved
docs/README.rst Outdated Show resolved Hide resolved
docs/README.rst Show resolved Hide resolved
docs/README.rst Outdated Show resolved Hide resolved
docs/README.rst Outdated Show resolved Hide resolved
docs/README.rst Outdated Show resolved Hide resolved
docs/README.rst Outdated Show resolved Hide resolved
docs/README.rst Outdated Show resolved Hide resolved
docs/README.rst Show resolved Hide resolved
@d-maurer
Copy link
Contributor Author

d-maurer commented Oct 21, 2020 via email

@jamadden
Copy link
Member

I would not mind, however, if you would directly improve the existing PR rather than make you own one.

I took you at your word and added some commits to this. (Whoops, at this writing realising I missed one, coming soon)

In an earlier comment I suggested that maybe it was good not to get into the weeds of pickle too much (that is, go into too much unnecessary detail). But as I was working on this, I found that actually giving some concrete details about pickle helped structure the discussion. Let me know how I can clarify or simplify.

@jamadden jamadden dismissed jensens’s stale review October 23, 2020 20:47

Substantial changes since then.

@d-maurer
Copy link
Contributor Author

@jamadden Thank you for the great introduction to class and interface persistence and the examples demonstrating potential caveats of the interface equality defintion!

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.

None yet

3 participants