Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
getters and setters
#11
(May-16-2017, 04:27 AM)Skaperen Wrote: what should i do in place of that dictionary of constant keys and/or the function that returns it?

i am thinking of making it be a global to the module and have the get_opts() function return (maybe a copy) of it and also have the set_opts() function use the keys from it in place of option_names_all in the inner loop scanning the passed option, so there just a single place defining what are the options to set and what are the options to get.  it would still by a dictionary with constant keys.

what is a named tuple reflex?

It's using a named tuple where it makes sense.
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Can property getters and setters have additional arguments? pjfarley3 2 3,053 Oct-30-2020, 12:17 AM
Last Post: pjfarley3
  rework of a little python-script - extending getters and setters apollo 7 4,274 Nov-04-2018, 01:37 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020