Python does not have the new keyword. You simply call the class name as a function.
You can specify keyword arguments using a dictionary, the dictionary prefix with ** , for example:
options = { "param1": "foo", "param2": "bar", "param3": "baz" } my_a = A(**options)
If you intend to define all values ββat once, using a dictionary does not give you any advantages over simply specifying them directly, using extra spaces for clairity:
my_a = A( param1 = "foo", param2 = "bar", param3 = "baz" )
source share