|
|
|
|
|
by Aefiam
294 days ago
|
|
case .foo is explicitly mentioned in https://peps.python.org/pep-0622/ : > While potentially useful, it introduces strange-looking new syntax without making the pattern syntax any more expressive. Indeed, named constants can be made to work with the existing rules by converting them to Enum types, or enclosing them in their own namespace (considered by the authors to be one honking great idea)[...]
If needed, the leading-dot rule (or a similar variant) could be added back later with no backward-compatibility issues. second: you can use case MyObject() as obj: print(obj) |
|