On 2021-06-24 09:19:36, Christopher Barker wrote:
> No -- we're not assuming Python users are idiots -- there is an important
> difference here:
> 
>     from extensions import flatten
>     flatten(mylist)
> 
> very clearly adds the name `flatten` to the current module namespace. That
> itself can be confusing to total newbies, but yes, you can't get anywhere
> with Python without knowing that. Granted, you still need need to know what
> `flatten` is, and what it does some other way in any case. Whereas:
> 
>     from extensions use flatten
>     mylist.flatten()
> 
> does NOT import the name `flatten` into the local namespace -- which I
> suppose will be "clear" because it's using "use" rather than a regular
> import, but that might be subtle. But importantly, what it has done is add
> a name to some particular type -- what type? who knows?

This explicit namespacing is an important objection, IMHO.

What about this syntax:

> from extensions use flatten in list

And symmetrically:

> from extensions use * in list

Going even further (maybe too far):

> from extensions use * in *
_______________________________________________
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/WOINSXVW3HNDIY5ZKI72KCSGIZMYI55J/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to