> On Behalf Of J. Cliff Dyer
> On the other hand, this is just as bad:
>
> [ ( y ) for ( x , y ) in [ ( "foo" , 2 ) , ( "bar" , 4 ) ] if
> "foo" in ( x ) ]
I think that's allowed in order to recruit C/C++ programmers.
Regards,
Ryan Ginstrom
--
http://mail.python.org/mailman/listinfo/python-li
Marc 'BlackJack' Rintsch wrote:
> But please don't use the functions in `string` that are also available as
> methods on strings. Those functions are deprecated.
>
>
Meaning (for newbie clarification):
instead of string.upper(s2), just do s2.upper(). For more detail, see
the docs.
--
http
On Sat, 15 Sep 2007 16:07:07 +, Grant Edwards wrote:
> It's nice people have invented so many ways to spell the builting "map"
> ;)
>
",".join(map(str,[1,2,3]))
> '1,2,3'
The oldest solution, and if not the fastest, at least neck-and-neck with
the list comprehension.
>>> timeit.Time
On Sun, 16 Sep 2007 00:05:58 +, Marc 'BlackJack' Rintsch wrote:
> On Sat, 15 Sep 2007 14:58:15 -0700, James Stroud wrote:
>
>> I was staring at a segment of code that looked like this today:
>>
>> for something in stuff[x:y]:
>> whatever(something)
>>
>> and was wondering if the c
On 9 16 , 2 51 , [EMAIL PROTECTED] wrote:
> http://freesoftwareupgrades.blogspot.com/
what
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 16 Sep 2007 09:14:57 +0900, Ryan Ginstrom wrote:
>> On Behalf Of J. Cliff Dyer
>> On the other hand, this is just as bad:
>>
>> [ ( y ) for ( x , y ) in [ ( "foo" , 2 ) , ( "bar" , 4 ) ] if "foo" in
>> ( x ) ]
>
> I think that's allowed in order to recruit C/C++ programmers.
Heh :)
In
On Sat, 15 Sep 2007 02:45:10 -0700, James Stroud wrote:
> Steven D'Aprano wrote:
>> On Fri, 14 Sep 2007 18:19:45 -0700, James Stroud wrote:
>>
How do I subclass int and/or long so that my class also auto-converts
only when needed?
>>> Use __new__.
>>
>> The disadvantage of that is
John Machin wrote:
> On 16/09/2007 8:11 AM, James Stroud wrote:
>> Steve Holden wrote:
>>> I don't know why you have a bug up your ass about it, as the
>>> Americans say.
>> I think most Americans say "wild hare up your ass".
>
> The essence of Steve's point appears to be that the OP has ridden in
:)
--
http://mail.python.org/mailman/listinfo/python-list
Anybody introdcing something on the subject?
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 15 Sep 2007 03:25:27 +, mouseit wrote:
> I'm trying to add an element to a list which is a property of an
> object, stored in an array. When I append to one element, all of the
> lists are appended!
>
> Example Code:
>
> class Test:
> array = []
>
> myTests = [Test() , Test() ,
Grant Edwards wrote:
> On 2007-09-15, Robert Kern <[EMAIL PROTECTED]> wrote:
>> Grant Edwards wrote:
>>> On 2007-09-15, Erik Jones <[EMAIL PROTECTED]> wrote:
>>>
>> print ''.join([str(i) for i in [1,2,3]])
> It's better to use generator comprehension instead of LC:
>
> ",".join(str(
Rob E wrote:
> On Sat, 15 Sep 2007 03:25:27 +, mouseit wrote:
>
>> I'm trying to add an element to a list which is a property of an
>> object, stored in an array. When I append to one element, all of the
>> lists are appended!
>>
>> Example Code:
>>
>> class Test:
>> array = []
>>
>> myTes
Steven D'Aprano <[EMAIL PROTECTED]> writes:
> In *general* the compiler can't tell, but in specific cases it
> could. A (hypothetical) optimizing compiler would tell the
> difference between:
>
> for item in alist[1:5]:
> print item # no possible side-effects
The 'print' statement converts t
On Sep 14, 10:30 am, Mark Morss <[EMAIL PROTECTED]> wrote:
> I would like to construct a class that includes both the integers and
> None. I desire that if x and y are elements of this class, and both
> are integers, then arithmetic operations between them, such as x+y,
> return the same result as
I'm trying to detect and intelligently deal with problems created when a
user of a Python CGI page uploads a file and then gets impatient and
clicks on some other button or the browser's cancel button (or even
closes the page). If the file is large enough, and the user is
impatient enough, thi
On Sun, 16 Sep 2007 00:40:13 +, Steven D'Aprano wrote:
> On Sun, 16 Sep 2007 00:05:58 +, Marc 'BlackJack' Rintsch wrote:
>
> In *general* the compiler can't tell, but in specific cases it could. A
> (hypothetical) optimizing compiler would tell the difference between:
>
>
> for item in
7stud <[EMAIL PROTECTED]> wrote:
> Used copies of computer books for out of date editions are always
> cheap. "Python in a Nutshell (2nd ed)" is a reference book with a
> frustratingly poor index--go figure. It also contains errors not
> posted in the errata.
You can always enter errata at
101 - 118 of 118 matches
Mail list logo