Paul Sokolovsky wrote:
object(host=as host, port=as port}:", but that couldn't ever be I'd like to point out the weirdness of the "as" syntax when applied to
Hello, On Tue, 5 Jan 2021 20:37:27 +1000 Nick Coghlan ncoghlan@gmail.com wrote: positional arguments, e.g.: case [as x, as y]: case Cls(as x, as y): That feels unnatural, and the fact behind that intuitive feeling is that "as" never used like that in Python so far. Where it's used now, there's explicit "what" is available before "as": import org_name as alias_name with expr as var: So again, standalone "as" feels weird.
It's a matter of taste, I like the compacity of the standalone as. It describe clearly the variable name, and the order matches the positional arguments so I don't find it surprising. If it's not the positional value, what else can it be ? What would be clearer by using an underscore, which itself corresponds to nothing ? The fact that it was never used like this it not an argument per se, because that's the point of new syntax...