0

I want to understand what does the comma do between self.data and self.next = data. Thanks

class Node(object):
  def __init__(self, data, nxt = None):
    self.data, self.next = data, nxt
class Context(object):
  def __init__(self, source, dest):
    self.source, self.dest = source, dest
TheMaster
  • 45,448
  • 6
  • 62
  • 85
Chochu
  • 23
  • 4

1 Answers1

7

This

self.source, self.dest = source, dest

Does this

self.source = source
self.dest = dest

It is just a multivariable definition on a single line

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245