Antoon Pardon wrote:
> No it wasn't. From what I have picked up, the ternary operator
> was finaly introduced after one of the developers tripped over
> the commonly used idiom to simulate a ternary operator, which
> can fail in certain cases.
>
> Anyway, when I was arguing for a ternary operator
peter
would not the more correct way to do this be short circuit
evaluation. somthing along lines of
if (len(item) > 0) and (item[0] == '-'): pass
seems to be the more correct approach. rather than relying on slicing
to return an empty string. For instance suppose you wanted to test to
see if th
Hello,
I'm a newbie to python. I run python under Manddrake Linux 10.2 from a
terminal.
While in the interactive mode, i need to use the tab key to indent my
code. However, i get a message "List all 174 possibilities? (Y/N)"
instead of an indent. So i use spaces.
How do i tell python to give me i
i think it is telling you to use spaces
btw i have no idea, it just sounds like a funny thing to happen
--
http://mail.python.org/mailman/listinfo/python-list
Christoph Zwerschke <[EMAIL PROTECTED]> writes:
> Mike Meyer wrote:
>> Any object for which hash() returns an appropriate value(1) can be
>> used as a dictionary key/set element. Lists, sets and dicts are not
>> hashable, and can not be used. Tuples can be used if all the things
>> they contain are
Jean-Paul Calderone <[EMAIL PROTECTED]> writes:
> >I can't think of a single use case for the addition (+) operator
> >working where either of the operands happens to be the number
> >0x15f1ef02d9f0c2297e37d44236d8e8ddde4a34c96a8200561de00492cb94b82 (a
> >random number I just got out of /dev/urando
Tim Henderson <[EMAIL PROTECTED]> wrote:
...
> Hi
>
> The question why are there no sorted dictionaries in python, seems to
> pop up with unseeming regularity. That question in itself in
> nonsensical sense dictionaries are hash-maps, however should python
> have a sorted map type object is a g
ahh, i hadn't thought of using a proirity queue but that is the correct
solution most of the time, except i suppose when you have input that
causes you to excessively reheap which could be problematic.
i may still look into writing a general sorted map though, it could be
useful especially if ther
It seems that the distinction between tuples and lists has slowly been
fading away. What we call "tuple unpacking" works fine with lists on
either side of the assignment, and iterators on the values side. IIRC,
"apply" used to require that the second argument be a tuple; it now
accepts sequences, a
Mike Meyer <[EMAIL PROTECTED]> writes:
> The new intended use is as an immutable sequence type, not a
> "lightweight C struct". The new name to denote this new use -
> following in the footsteps of the set type - is "frozenlist". The
> changes to the implementation would be adding any non-mutating
Mike Meyer wrote:
> It seems that the distinction between tuples and lists has slowly been
> fading away. What we call "tuple unpacking" works fine with lists on
> either side of the assignment, and iterators on the values side. IIRC,
> "apply" used to require that the second argument be a tuple; i
101 - 111 of 111 matches
Mail list logo