[Numpy-discussion] Proposal to support __format__
Marten van Kerkwijk
m.h.vankerkwijk at gmail.com
Wed Feb 15 11:03:51 EST 2017
This is great! A few quick comments (mostly echo-ing Stephan's).
1. You basically have a NEP already! Making a PR from it allows to
give line-by-line comments, so would help!
2. Don't worry about supporting python2 specifics; just try to ensure
it doesn't break; I would not say more about it!
3. On `set_printoptions` -- ideally, it will become possible to use
this as a context (i.e., `with set_printoption(...)`). It might make
sense to have an `override_format` keyword argument to it.
4. Otherwise, my main suggestion is to start small with the more
obvious ones, and not worry too much about format validation, but
rather about getting the simple ones to work well (e.g., for an object
array, just apply the format given; if it doesn't work, it will error
out on its own, which is OK).
5. One bit of detail: the "g" one does confuse me.
All the best,
More information about the NumPy-Discussion