On Thu, 22 Oct 2020 at 14:44, Chris Angelico <ros...@gmail.com> wrote:
> Returning a dict
> would be FAR less convenient for the most common cases, but as you
> say, it'd be the fallback for when you need dynamic parsing.

If you're that sure that direct assignment to locals would be a killer
feature (I'm not, but you seem to be unimpressed by any scanning
proposal that *doesn't* include it) maybe a better syntax proposal
would be something that takes a dict (or more generally maybe a
"namespace") and injects it into locals? That could be used by a
scanner function, as well as any other library that wanted a "directly
assign variables" interface. So rather than

f"{var1} {var2} {var3}" = target

we'd have

inject_vars parser("{var1} {var2} {var3}", target)

and people who don't like/want variable assignment can just use
parser() as a normal function returning a dict.

If you're interested in something like that (I'm not) make it a new
thread, though, as it's way off topic for this thread.
Paul
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/N7ZPPYF6GQC6HHVRKZSSRS6CKS4HO5UC/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to