Can property getters and setters have additional arguments?

Chris Angelico rosuav at gmail.com
Sat Oct 31 12:49:09 EDT 2020


On Sun, Nov 1, 2020 at 3:46 AM <pjfarley3 at earthlink.net> wrote:
>
> I asked this question over on the python-forum-io group but haven't gotten
> much in the way of answers.  I hope someone here can advise me.
>
> I am trying to implement getters and setters in a class using a numpy array
> as the base instance value, but I am not able to pass an array index
> argument to the getter function (and probably not to the setter function,
> but it never gets that far).
>

I'm not sure why you're using getters and setters there, but I think
what you want is best handled with a simple member function. Try to
keep it really really simple and it'll almost certainly be correct.

ChrisA


More information about the Python-list mailing list