Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
caching attribute reference
#6
I'm confused, if it's a class method, how does it get an instance? Is it a singleton? If not, how do you identify which instance?

If you want to modify it, I suggest not caching it, since it would make it slightly more likely to accidentally modify the cached one instead of the correct one. We shouldn't bother with performance improvements like this unless we've run the code and find it necessary.
Reply


Messages In This Thread
caching attribute reference - by Skaperen - Feb-21-2017, 06:24 AM
RE: caching attribute reference - by Larz60+ - Feb-21-2017, 10:42 AM
RE: caching attribute reference - by wavic - Feb-21-2017, 10:51 AM
RE: caching attribute reference - by ichabod801 - Feb-22-2017, 02:08 AM
RE: caching attribute reference - by Larz60+ - Feb-21-2017, 10:53 AM
RE: caching attribute reference - by wavic - Feb-21-2017, 11:02 AM
RE: caching attribute reference - by micseydel - Feb-21-2017, 05:30 PM
RE: caching attribute reference - by Larz60+ - Feb-21-2017, 05:37 PM
RE: caching attribute reference - by micseydel - Feb-21-2017, 06:00 PM
RE: caching attribute reference - by Larz60+ - Feb-21-2017, 08:00 PM
RE: caching attribute reference - by Skaperen - Feb-22-2017, 01:44 AM
RE: caching attribute reference - by Ofnuts - Feb-22-2017, 08:00 AM
RE: caching attribute reference - by micseydel - Feb-22-2017, 01:45 AM
RE: caching attribute reference - by Skaperen - Feb-22-2017, 02:16 AM
RE: caching attribute reference - by Skaperen - Feb-22-2017, 09:14 AM
RE: caching attribute reference - by Ofnuts - Feb-22-2017, 10:59 AM
RE: caching attribute reference - by wavic - Feb-22-2017, 11:20 AM
RE: caching attribute reference - by micseydel - Feb-23-2017, 03:43 AM
RE: caching attribute reference - by Ofnuts - Feb-23-2017, 08:12 AM
RE: caching attribute reference - by Skaperen - Feb-23-2017, 09:53 AM
RE: caching attribute reference - by micseydel - Feb-23-2017, 03:53 PM
RE: caching attribute reference - by Ofnuts - Feb-23-2017, 11:18 PM
RE: caching attribute reference - by wavic - Feb-23-2017, 04:20 PM
RE: caching attribute reference - by Skaperen - Feb-24-2017, 06:04 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pass by object reference when does it behave like pass by value or reference? mczarnek 2 2,637 Sep-07-2020, 08:02 AM
Last Post: perfringo

Forum Jump:

User Panel Messages

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