[SciPy-dev] alternate .flags interface
Travis Oliphant
oliphant at ee.byu.edu
Mon Oct 31 12:17:12 EST 2005
Perry Greenfield wrote:
>I'm wondering if the current flags interface couldn't be made a bit
>easier to use to allow mapping of dictionary keys in to attributes. For
>example:
>
>instead of arr.flags["CONTIGUOUS"]
>
>arr.flags.contiguous
>
>If using a dictionary is considered useful (e.g., for getting the whole
>state, it is still possible to allow arr.flags to return a dictionary
>derived object that can be used wherever dictionaries are accepted, and
>likewise, assigning to arr.flags should be able to take a dictionary of
>flags. Any reason we can't support this interface?
>
>
>
Actually this would be easy, because arr.flags already returns a special
object defined in
scipy/base/_internal.py. So yes, it could be done.
-Travis
More information about the SciPy-Dev
mailing list