On Friday, September 23, 2016 at 2:23:58 AM UTC-4, Nick Coghlan wrote:
>
> On 23 September 2016 at 15:50, Greg Ewing > wrote:
> > אלעזר wrote:
> >>
> >> it feels like a
> >> placeholder for this meaning would be better. E.g.:
> >>
> >> class A:
> >> def __add__(self, other:
I really like this idea, and in the rare case that someone adds an element
to a class with the same name as the class that would shadow your
definition, but that seems fine to me.
On Thursday, September 22, 2016 at 11:09:28 PM UTC-4, Nick Coghlan wrote:
>
> On 23 September 2016 at 12:05, אלעזר
On 27 September 2016 at 17:29, Neil Girdhar wrote:
> On Friday, September 23, 2016 at 2:23:58 AM UTC-4, Nick Coghlan wrote:
>> The difference between that and the "methods referring to the class
>> they're defined in" case is that it's likely to be pretty normal to
>> want to do the latter, so it
Neil Girdhar writes:
> I agree that circularity should in general be avoided, but it's not always
> possible or elegant to do that. Sometimes you really need two classes to
> refer to each other. In that case, why not expose your placeholder idea to
> the user via a library?
Why not just
I don't understand why that would work and this clearly doesn't?
Mutual2 = "Mutual2" # Pre-declare Mutual2
class Mutual1:
def spam(self, x=Mutual2):
print(type(x))
class Mutual2:
def spam(self):
pass
Mutual1().spam()
prints class "str" rather than "type".
On Tue, Sep
On Tue, Sep 27, 2016 at 11:54:40AM +, Neil Girdhar
wrote:
> I don't understand why that would work and this clearly doesn't?
>
> Mutual2 = "Mutual2" # Pre-declare Mutual2
>
> class Mutual1:
> def spam(self, x=Mutual2):
^^^ - calculated at compile time,
Yes, I understand that, but I don't see how that would help at all with
annotations. Aren't annotations also evaluated at "compile time"?
On Tue, Sep 27, 2016 at 8:14 AM Oleg Broytman wrote:
> On Tue, Sep 27, 2016 at 11:54:40AM +, Neil Girdhar <
> mistersh...@gmail.com> wrote:
> > I don't u
On 27 September 2016 at 13:46, Neil Girdhar wrote:
> Yes, I understand that, but I don't see how that would help at all with
> annotations. Aren't annotations also evaluated at "compile time"?
Yes, but a string whose value is a class name is treated as being the
same annotation (i.e., meaning th
On Tue, Sep 27, 2016 at 5:01 AM Nick Coghlan wrote:
> On 27 September 2016 at 17:29, Neil Girdhar wrote:
> > On Friday, September 23, 2016 at 2:23:58 AM UTC-4, Nick Coghlan wrote:
> >> The difference between that and the "methods referring to the class
> >> they're defined in" case is that it's
On 27 September 2016 at 22:46, Neil Girdhar wrote:
> Yes, I understand that, but I don't see how that would help at all with
> annotations. Aren't annotations also evaluated at "compile time"?
This thread isn't about circular references in general, just circular
references in the context of type
On Sun, Sep 11, 2016 at 12:28 PM, Bernardo Sulzbach
wrote:
> On 09/11/2016 06:36 AM, Dominik Gresch wrote:
>>
>> So I asked myself if a syntax as follows would be possible:
>>
>> for i in range(10) if i != 5:
>> body
>>
>> Personally, I find this extremely intuitive since this kind of
>> if-st
On 28 September 2016 at 00:55, Erik Bray wrote:
> On Sun, Sep 11, 2016 at 12:28 PM, Bernardo Sulzbach
> wrote:
>> On 09/11/2016 06:36 AM, Dominik Gresch wrote:
>>>
>>> So I asked myself if a syntax as follows would be possible:
>>>
>>> for i in range(10) if i != 5:
>>> body
>>>
>>> Personally
I don't know if it works on Windows, but at least in Linux pressing
Ctrl-L will do exactly what you describe (as long as the REPL uses readline)
On 17.09.2016 12:51, João Matos wrote:
> Hello,
>
> I would like to suggest adding a clear command (not function) to Python.
> It's simple purpose would
On Tue, Sep 27, 2016 at 5:33 PM, Nick Coghlan wrote:
> On 28 September 2016 at 00:55, Erik Bray wrote:
>> On Sun, Sep 11, 2016 at 12:28 PM, Bernardo Sulzbach
>> wrote:
>>> On 09/11/2016 06:36 AM, Dominik Gresch wrote:
So I asked myself if a syntax as follows would be possible:
>>>
On 27 September 2016 at 16:54, Erik Bray wrote:
> Then following my own logic it
> would be desirable to also allow the nested for loop syntax of list
> comprehensions outside them as well.
I'd say that it's a case where we should either allow arbitrary
concatenation outside of comprehensions, or
Hello,
It doesn't work in Windows.
Best regards,
JM
terça-feira, 27 de Setembro de 2016 às 16:40:42 UTC+1, Dennis Brakhane via
Python-ideas escreveu:
> I don't know if it works on Windows, but at least in Linux pressing
> Ctrl-L will do exactly what you describe (as long as the REPL uses
Erik Bray wrote:
Then following my own logic it
would be desirable to also allow the nested for loop syntax of list
comprehensions outside them as well.
The only use for such a syntax would be to put
an inadvisable amount of stuff on one line.
When describing a procedural series of steps,
the
17 matches
Mail list logo