6

The code I'm using has a class definition, and the __init__ method contains a * as an argument. As a simple example,

class Foo:
    def __init__(self, *, bar=None):
        self.bar = bar

This is working code in Python 3.6 . What does the * argument do?

Tim
  • 2,756
  • 1
  • 15
  • 31

0 Answers0