Can we initialize python objects with statement like this:
a = b = c = None
it seems to me when I did a = b = c = list() will cause circular reference count issue.
Please give your expert advice.
Can we initialize python objects with statement like this:
a = b = c = None
it seems to me when I did a = b = c = list() will cause circular reference count issue.
Please give your expert advice.
No. That's equivalent to:
c = list() b = c a = b
There is no problem. Why did you think there would be an issue?
There are no cycles in your corde and even if there were, python's garbage collector can handle circular reference fine, so you don't ever need to worry about that.
However your code has another (possible) problem: All three variables will point to the same list. This means that changing e.g. a, will also change b and c (where by "changing" I mean calling a mutating operation like e.g. append. Reassigning a variable will not affect the other variables).
Yes, you can do that. There is no circular reference in your code and even if there were, it wouldn't cause any problems as Python has a garbage collector that correctly handles cycles.