Python Forum
iterate over class properties?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iterate over class properties?
#5
(Aug-26-2018, 07:02 PM)Gribouillis Wrote: It works. The drawback is that you're going to recompute the list of properties for each instance for which you're calling this function. I only attempted to compute the list only once for each class.

So does your way import the function into every class? If so your way is better. Is there a way to extend classes globally so that you can add functions to any class you inport into your code? I only did it my way because I didn't understand what is going on completely with yours, if you can help me understand it better (exactley what's going on) i'd like to have a variation of my function available within every class, but I'm a bit squemish about not exactley knowing what's going on in my own code. I'd rather you teach me how to fish than give me a fish. I find the documentation for python isn't exactly targeted towards people like me who need a bit more explaining to know what's going on, it tends to use terminology that i don't understand and when trying to understand the terminology it references stuff i don't know much or anything about so i have to look that up and i get frustrated. Now there are sites that walk you hand in hand through python coding with easily understandable examples and dumbed-down terminology.. but only for the very simple parts of python. If you would have not pointed me to inspect, I'd have never found it.
Reply


Messages In This Thread
iterate over class properties? - by NobahdiAtoll - Aug-26-2018, 10:44 AM
RE: iterate over class properties? - by Gribouillis - Aug-26-2018, 03:21 PM
RE: iterate over class properties? - by Gribouillis - Aug-26-2018, 07:02 PM
RE: iterate over class properties? - by NobahdiAtoll - Aug-26-2018, 07:21 PM
RE: iterate over class properties? - by Gribouillis - Aug-26-2018, 07:26 PM
RE: iterate over class properties? - by Gribouillis - Aug-26-2018, 07:46 PM
RE: iterate over class properties? - by Gribouillis - Aug-26-2018, 08:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PDF properties doesn't show created or modified date Pedroski55 4 1,174 Jun-19-2023, 08:09 AM
Last Post: Pedroski55
  How do I list properties quarinteen 0 1,086 May-01-2022, 04:15 PM
Last Post: quarinteen
  API design question: use methods or properties? johsmi96 1 1,720 Oct-12-2020, 02:24 PM
Last Post: buran
  Create a 3D volume with some properties. Rosendo 0 1,467 Jul-18-2020, 08:20 PM
Last Post: Rosendo
  printing class properties from numpy.ndarrays of objects pjfarley3 2 1,997 Jun-08-2020, 05:30 AM
Last Post: pjfarley3
  adding properties to variables rudihammad 0 1,713 May-06-2020, 05:09 AM
Last Post: rudihammad
  Advance properties read from xml files python1234 0 2,453 Apr-25-2018, 01:42 PM
Last Post: python1234

Forum Jump:

User Panel Messages

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