On 12.09.2013 01:27, Chris Angelico wrote:
> On Thu, Sep 12, 2013 at 6:41 AM, Markus Rother wrote:
>> 3. The default return value of methods is None instead of self.
>> If it was self, it would be possible to chain method calls (which
>> is called a
On 11.09.2013 23:15, Ethan Furman wrote:
> On 09/11/2013 01:41 PM, Markus Rother wrote:
>> >>> () == []
>> False
>>
>> But:
>>
>> >>> bool(().__eq__([]))
>> True
>
> This is not a trap, this is simply
On 10.09.2013 08:09, Steven D'Aprano wrote:
> What design mistakes, traps or gotchas do you think Python has? Gotchas
> are not necessarily a bad thing, there may be good reasons for it, but
> they're surprising.
I have one more:
Dictionaries should iterate over their items instead of their key
Hello all,
Thanks for this thread. Here are my two cents...
On 10.09.2013 08:09, Steven D'Aprano wrote:
> What design mistakes, traps or gotchas do you think Python has? Gotchas
> are not necessarily a bad thing, there may be good reasons for it, but
> they're surprising.
"""
1. Occas
comparison
into another function/method.
Best regards,
Markus R.
On 05.08.2013 01:06, Chris Angelico wrote:
On Sun, Aug 4, 2013 at 11:35 PM, Markus Rother wrote:
Hello,
The following behaviour seen in 3.2 seems very strange to me:
As expected:
() == []
False
However:
().__eq__([])
NotI
Hello,
The following behaviour seen in 3.2 seems very strange to me:
As expected:
>>> () == []
False
However:
>>> ().__eq__([])
NotImplemented
>>> [].__eq__(())
NotImplemented
And:
>>> bool(NotImplemented)
True
Hence:
>>> bool(().__eq__([]))
True
>>> ( () == [] ) != ( ().__eq__([]) )
True
Ho
Hi,
You have to iterate.
Either with
for u in users:
fob.write( u + '\n' )
or with a lambda function.
always a good call: http://python.org/
greets,
M.
On 02/03/2012 09:27 PM, Anatoli Hristov wrote:
Hi everyone,
I`m totaly new in python and trying to figure out - how to write a
list t