[Numpy-discussion] [OT: MATLAB] Any way to globally make Matlab struct attributes Python-property-like

Ken Watford kwatford+scipy at gmail.com
Tue Sep 14 20:55:03 EDT 2010


On Mon, Sep 13, 2010 at 10:24 PM, David Goldsmith
<d.l.goldsmith at gmail.com> wrote:
> I.e., I'd, at minimum, like to globally replace
>
> get(Handel, 'Property')
>
> with
>
> object.Property
>
> and
>
> set(Handel, 'Property', value)
>
> with
>
> object.Property = value
>
> to an arbitrary level of composition.

Both structures and objects of both handle and value types work
exactly like you're asking for.

You're probably talking about "handle graphics" objects (which are
just opaque numeric values representing things related to the UI),
which do still require the get/set functions. They're just doubles,
after all. It should be feasible to write a class that wraps them for
ease of use, but that wouldn't be a topic for here. If that intrigues
you, try asking about it on StackOverflow.



More information about the NumPy-Discussion mailing list