Python Forum
Why is this pointing to the objects
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why is this pointing to the objects
#3
(Apr-09-2019, 07:44 PM)Gribouillis Wrote: There is really nothing to understand here: variables stored in the class object A, such as A.l are shared by all the instances of that class.

Sure - that exactly is the question, why? When I create two different object of type class A. Shouldn't that create two different list? Or is this some sort optimization i've overlooked all this time?
Reply


Messages In This Thread
Why is this pointing to the objects - by hshivaraj - Apr-09-2019, 07:22 PM
RE: Why is this pointing to the objects - by hshivaraj - Apr-09-2019, 07:47 PM
RE: Why is this pointing to the objects - by Yoriz - Apr-09-2019, 08:00 PM
RE: Why is this pointing to the objects - by Yoriz - Apr-09-2019, 08:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Sorting Elements via parameters pointing to those elements. rpalmer 3 2,737 Feb-10-2021, 04:53 PM
Last Post: rpalmer
  Installing Python and pointing it to required libraries hooiberg 2 4,439 May-13-2019, 05:55 PM
Last Post: ebolisa
  What are ways of pointing cross-compiled origin source line for python? wyvogew 2 2,924 Feb-02-2019, 03:16 PM
Last Post: wyvogew

Forum Jump:

User Panel Messages

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