-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
MAINT: Tidy up Maskedarray repr #9913
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
Conversation
This means we can implement `__unicode__` easily too, or perhaps `__format__` in future
2084109
to
6b41ba8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good to get this in. One small comment only.
numpy/ma/core.py
Outdated
@@ -3829,10 +3833,10 @@ def compress(self, condition, axis=None, out=None): | |||
_new._mask = _mask.compress(condition, axis=axis) | |||
return _new | |||
|
|||
def __str__(self): | |||
def __insert_masked_print(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only seeing this on this second reading, but I would make this "semi-private", i.e., a single underscore, partly just because it seems something people might want to call, but mostly since we don't use the class mangling much elsewhere in numpy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't use the class mangling much elsewhere in numpy
We give the users great power, they have to provide the great responsibility :)
@eric-wieser I'll make the change and merge if that is OK with you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go ahead.
Thanks Eric. |
Extracted from #9792, contains part of #9202 as well