I suspect because properties were not yet “cool” when Lisandro designed the
attribute system.

Numpy’s design similarly also predate a lot of the property semantics in
the higher abstraction interfaces of Python.

We attempted some of these tricks with pyclaw and I think regretted at
least some of them.

Aron



On Mon, Mar 6, 2023 at 9:19 PM Barry Smith <bsm...@petsc.dev> wrote:

>
>   How come petsc4py has the (nonstandard?) v.setAttr('name',value) and
> v.getAttr('name') instead of v.name notation? Could they be refactored to
> have "normal" attribute behavior? If not, could a v.hasAttr('name') be
> added?
>
>   Similarly, how come numpy arrays seem to have no way to set attributes
> on them?
>
>   PyTorch tensors seem to support the standard t.name handling of
> attributes.
>
>    Thanks

Reply via email to