May 28, 2016
2:34 a.m.
On 05/27/2016 06:32 PM, Greg Ewing wrote:
Nikolaus Rath wrote:
class Point: def __init__(self, y, x): self.y = y self.x = x
would your first example assign x == obj.x or x = obj.y?
The intention is that positional args in the pattern correspond to positional args in the object's constructor. To make that work, there will have to be some protocol for reversing the construction of an object.
Meaning we can *only* match on constructor arguments? What about attributes that are not set in the constructor, are we just out of luck for those? -- ~Ethan~