-
Notifications
You must be signed in to change notification settings - Fork 8
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
revision num print out by __repr__ #40
Comments
I think this is worth considering. But let me explain my reasoning for leaving it out so we can weigh our options. Many Python objects have >>> a = [1, 2, 3]
>>> a
[1, 2, 3]
>>> b = {'thing': 'stuff'}
>>> b
{'thing': 'stuff'}
>>> import collections
>>> c = collections.Counter({'a': 1, 'b': 2, 'c': 2})
>>> c
Counter({'b': 2, 'c': 2, 'a': 1}) This has called an "eval-able repr" because >>> client.new_sample(name='...')
Sample(name='...') If we include any of the read-only traits in the >>> Sample(name='...', revision=...) and then, mirroring the pattern above, tries to type: >>> sample = client.new_sample(name='...', revision=...) an error will be raised, because the On the other hand, it's handy to see the |
Breaking the pattern seems like what I would expect. If you can communicate read-only or system-controlled properties in a different way it would make sense to me. (UID is one that shouldn't be changed, I think) |
I see your point @danielballan. We may need break pattern. |
https://github.com/danielballan/amostra/blob/first-pass/amostra/objects.py#L44
I feel user may want to see revision num when then do
list(sample.revisions())
The text was updated successfully, but these errors were encountered: