Re: [Python-ideas] Restore the __members__ behavior to python3 for C extension writers

2017-06-14 Thread Nick Coghlan
On 15 June 2017 at 11:06, Nathaniel Smith wrote: > On Wed, Jun 14, 2017 at 1:54 PM, Barry Scott wrote: >> > On 13 Jun 2017, at 23:49, Chris Angelico wrote: >> > For that purpose, is it possible to use super().__dir__()? Are there >> >

Re: [Python-ideas] Restore the __members__ behavior to python3 for C extension writers

2017-06-14 Thread Ethan Furman
On 06/14/2017 01:54 PM, Barry Scott wrote: super().__dir__ looks at the class above me that is typically object() and so is not useful as it does not list the member function from my class or __mro__ or other stuff I may not be aware of that is important to return. __dir__ should return

Re: [Python-ideas] Restore the __members__ behavior to python3 for C extension writers

2017-06-14 Thread Chris Angelico
On Thu, Jun 15, 2017 at 6:54 AM, Barry Scott wrote: >> class Magic: >>def __getattr__(self, attr): >>if attr in self.generatables: >>return self.generated_value(attr) >>raise AttributeError >>def __dir__(self): >>return

Re: [Python-ideas] Restore the __members__ behavior to python3 for C extension writers

2017-06-14 Thread Barry Scott
> On 13 Jun 2017, at 23:49, Chris Angelico wrote: > > On Wed, Jun 14, 2017 at 8:09 AM, Terry Reedy wrote: >> Perhaps you are looking for __dir__, called by dir(). >> >> " dir([object]) >> >>Without arguments, return the list of names in the current

Re: [Python-ideas] ImportError raised for a circular import

2017-06-14 Thread Abdur-Rahmaan Janhangeer
anyways circular imports seem to be making people go for node.js rather than using python . . . Abdur-Rahmaan Janhangeer, Mauritius abdurrahmaanjanhangeer.wordpress.com On 13 Jun 2017 23:04, "Barry Scott" wrote: > Recently I fell into the trap of creating a circular

Re: [Python-ideas] ImportError raised for a circular import

2017-06-14 Thread Ivan Levkivskyi
On 14 June 2017 at 09:59, Paul Moore wrote: > On 13 June 2017 at 23:36, Chris Angelico wrote: > > On Wed, Jun 14, 2017 at 8:10 AM, Mahmoud Hashemi > wrote: > >> I didn't interpret the initial email as wanting an error on *all* >

Re: [Python-ideas] ImportError raised for a circular import

2017-06-14 Thread Paul Moore
On 13 June 2017 at 23:36, Chris Angelico wrote: > On Wed, Jun 14, 2017 at 8:10 AM, Mahmoud Hashemi wrote: >> I didn't interpret the initial email as wanting an error on *all* circular >> imports. Merely those which are unresolvable. I've definitely helped

Re: [Python-ideas] ImportError raised for a circular import

2017-06-14 Thread Nick Coghlan
On 14 June 2017 at 13:02, Mahmoud Hashemi wrote: > That would be amazing! If there's anything I can do to help make that > happen, please let me know. It'll almost certainly save that much time for > me alone down the line, anyway :) The `IMPORT_FROM` opcode's error handling