Re: PEP Idea: Extended import syntax for aliasing module attributes

2025-06-18 Thread Omar Ahmed via Python-list
The solution was provided in this thread here: https://discuss.python.org/t/extended-import-syntax-for-aliasing-module-attributes/95920/3 The correct way to implement is: import module from module import optimize, validate as check -- https://mail.python.org/mailman3//lists/python-list.python.org

Re: PEP Idea: Extended import syntax for aliasing module attributes

2025-06-18 Thread Omar Ahmed via Python-list
Thank you. I have used this link. I had difficulty finding it. https://discuss.python.org/ -- https://mail.python.org/mailman3//lists/python-list.python.org

Re: PEP Idea: Extended import syntax for aliasing module attributes

2025-06-18 Thread Omar Ahmed via Python-list
Thank you. I have posted this idea on https://discuss.python.org/c/ideas/6 I had difficulty trying to find that. -- https://mail.python.org/mailman3//lists/python-list.python.org

Re: PEP Idea: Extended import syntax for aliasing module attributes

2025-06-18 Thread Abdur-Rahmaan Janhangeer via Python-list
And here: https://discuss.python.org/c/ideas/6 Kind Regards, Abdur-Rahmaan Janhangeer about | blog github Mauritius On Tue, Jun 17, 2025 at 4:20 PM Barry Scott wrote: > > > > On 17

Re: PEP Idea: Extended import syntax for aliasing module attributes

2025-06-17 Thread Barry
On 17 Jun 2025, at 15:17, Neal Becker wrote: On Tue, Jun 17, 2025 at 8:19 AM Barry Scott <[1]ba...@barrys-emacs.org> wrote: > On 17 Jun 2025, at 00:19, Omar Ahmed via Python-list <[2]python-list@python.org> wrote: > > Hi all, > I would like to propose a potent

Re: PEP Idea: Extended import syntax for aliasing module attributes

2025-06-17 Thread Neal Becker via Python-list
On Tue, Jun 17, 2025 at 8:19 AM Barry Scott wrote: > > > > On 17 Jun 2025, at 00:19, Omar Ahmed via Python-list < > python-list@python.org> wrote: > > > > Hi all, > > I would like to propose a potential addition to Python's `import` syntax > that would improve clarity and ergonomics for cases whe

Re: PEP Idea: Extended import syntax for aliasing module attributes

2025-06-17 Thread Barry Scott
> On 17 Jun 2025, at 00:19, Omar Ahmed via Python-list > wrote: > > Hi all, > I would like to propose a potential addition to Python's `import` syntax that > would improve clarity and ergonomics for cases where developers want both > full module access *and* a local alias to a specific attr

Re: PEP Idea: Extended import syntax for aliasing module attributes

2025-06-16 Thread Rob Cliffe via Python-list
On 17/06/2025 00:19, Omar Ahmed via Python-list wrote: Hi all, I would like to propose a potential addition to Python's `import` syntax that would improve clarity and ergonomics for cases where developers want both full module access *and* a local alias to a specific attribute within that mod

PEP Idea: Extended import syntax for aliasing module attributes

2025-06-16 Thread Omar Ahmed via Python-list
Hi all, I would like to propose a potential addition to Python's `import` syntax that would improve clarity and ergonomics for cases where developers want both full module access *and* a local alias to a specific attribute within that module. Currently, to get both behaviors, we typically write: