Python Forum
assignment embedded in an expression
Thread Rating:
  • 3 Vote(s) - 2.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
assignment embedded in an expression
#11
 >>> a,b,c={},{},{}
>>> id(a)
4672848
>>> id(b)
31840992
>>> id(c)
31841952
Reply
#12
yeah, that's how i ended up doing it ... perhaps on separate lines, depending on the overall code style of that project.

this is what i was, rightly, afraid of:
>>> a=b=c={}
>>> id(a),id(b),id(c)
(140648494231240, 140648494231240, 140648494231240)
>>>
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Pass results of expression to another expression cmdr_eggplant 2 2,283 Mar-26-2020, 06:59 AM
Last Post: ndc85430
  assignment: not an operator nor expression, but x=y=z=3 works fine? jefdaels 1 2,183 Jan-29-2019, 02:19 PM
Last Post: perfringo

Forum Jump:

User Panel Messages

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