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
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 wh

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

2025-06-17 Thread Barry
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. > FYI python ide

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

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

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

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

Re: import syntax

2013-07-31 Thread Chris Angelico
On Mon, Jul 29, 2013 at 11:37 PM, Joshua Landau wrote: > 2d) Realise that the slow part is not what you thought it was This step is mandatory. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: import syntax

2013-07-30 Thread Neil Cerutti
On 2013-07-29, Joshua Landau wrote: > Sure, just as one light is no brighter or dimmer than another > when disregarding luminosity. > > As people have said, it improves diffs as well. It flows > quicker into the "from module import things" form (which I oft > prefer), too. > > When asking these qu

Re: import syntax

2013-07-29 Thread Devyn Collier Johnson
On 07/29/2013 06:37 PM, Joshua Landau wrote: On 29 July 2013 21:23, Devyn Collier Johnson > wrote: On 07/29/2013 04:20 PM, Tim Chase wrote: On 2013-07-29 16:09, Dave Angel wrote: On 07/29/2013 03:48 PM, Devyn Collier Johnson wrote:

Re: import syntax

2013-07-29 Thread Joshua Landau
On 29 July 2013 21:23, Devyn Collier Johnson wrote: > > On 07/29/2013 04:20 PM, Tim Chase wrote: > >> On 2013-07-29 16:09, Dave Angel wrote: >> >>> On 07/29/2013 03:48 PM, Devyn Collier Johnson wrote: >>> The PEP8 recommends importing like this: import os import re no

Re: import syntax

2013-07-29 Thread Devyn Collier Johnson
On 07/29/2013 04:20 PM, Tim Chase wrote: On 2013-07-29 16:09, Dave Angel wrote: On 07/29/2013 03:48 PM, Devyn Collier Johnson wrote: The PEP8 recommends importing like this: import os import re not like this: import os, re I got a bit further, and if I'm only using a couple of functions fr

Re: import syntax

2013-07-29 Thread Tim Chase
On 2013-07-29 16:09, Dave Angel wrote: > On 07/29/2013 03:48 PM, Devyn Collier Johnson wrote: > > The PEP8 recommends importing like this: > > > > import os > > import re > > > > not like this: > > > > import os, re > > I got a bit further, and if I'm only using a couple of functions > from the imp

Re: import syntax

2013-07-29 Thread Tim Chase
On 2013-07-29 15:48, Devyn Collier Johnson wrote: > The PEP8 recommends importing like this: > > import os > import re > > not like this: > > import os, re > > Why is that? Is there a performance advantage to one of the styles? While I don't believe there's much of a performance difference (if

Re: import syntax

2013-07-29 Thread Dave Angel
On 07/29/2013 03:48 PM, Devyn Collier Johnson wrote: The PEP8 recommends importing like this: import os import re not like this: import os, re Why is that? Is there a performance advantage to one of the styles? Pep 8 is not about performance, it's about readability. And unless the two l

Re: import syntax

2013-07-29 Thread Joel Goldstick
On Mon, Jul 29, 2013 at 3:48 PM, Devyn Collier Johnson wrote: > The PEP8 recommends importing like this: > > import os > import re > > not like this: > > import os, re > > Why is that? Is there a performance advantage to one of the styles? > > > Mahalo, > > Devyn Collier Johnson > devyncjohn...@gm

import syntax

2013-07-29 Thread Devyn Collier Johnson
The PEP8 recommends importing like this: import os import re not like this: import os, re Why is that? Is there a performance advantage to one of the styles? Mahalo, Devyn Collier Johnson devyncjohn...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list