On 2/22/07, Neal Becker <[EMAIL PROTECTED]> wrote:
Mike Klaas wrote:
> On 2/22/07, Neal Becker <[EMAIL PROTECTED]> wrote:
>
>> Well consider this:
>> >>>str (4)
>> '4'
>> >>>int(str (4))
>> 4
>> >>>str (False)
>> 'False'
>>
>> >>>bool(str(False))
>> True
>>
>> Doesn't this seem a bit inconsisen
Fredrik Lundh wrote:
> Ka-Ping Yee wrote:
>
>
>> I'd say, don't pretend m is a sequence. Pretend it's a mapping.
>> Then the conceptual issues go away.
>>
>
> almost; that would mean returning KeyError instead of IndexError for
> groups that don't exist, which means that the common patt
Fredrik Lundh wrote:
> Martin v. Löwis wrote:
>
>
>>> it can quickly become rather confusing if you also interpret m[:] as
>>> m.groups(), not to mention if you add len() and arbitrary slicing to
>>> the mix. what about m[] and m[i,j,k], btw?
>>>
>> I take it that you are objecting to
Ben Wing wrote:
> [interpolated strings]
btw if people think this idea is good, i can certainly write it up in
PEP form.
ben
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
h
sorry to be casting multiple ideas at once to the list. i've been
looking into other languages recently and reading the recent PEP's and
such and it's helped crystallize ideas about what could be better about
python.
i see in PEP 3101 that there's some work going on to fix up the string
forma
Terry Reedy wrote:
> Iterate in reverse and no index adjustment is needed
>
>
>
a good idea, thanks.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/op
Brian Harring wrote:
> On Sun, Dec 03, 2006 at 08:35:58PM -0600, Ben Wing wrote:
>
>> but i still don't see why supporting iter.delete() is so wrong. clearly
>> it doesn't need to work on files or other such things where it doesn't
>> make sense.
>
i don't like the current super() at all. having to type super(Foo,
self).__init__(...) is messy, hard to remember, and error-prone. it
also introduces an unfortunate dependency in that the name of the class
(Foo) has to be hard-coded in the call, and if you change the class name
you also have
Brian Harring wrote:
> On Sun, Dec 03, 2006 at 06:24:17AM -0600, Ben Wing wrote:
>
>> many times writing somewhat complex loops over lists i've found the need
>> to sometimes delete an item from the list. currently there's no easy
>> way to do so; basically
Martin v. Löwis wrote:
> Aahz schrieb:
>
this one is fairly simple. if `m' is a match object, i'd like to be
able to write m[1] instead of m.group(1). (similarly, m[:] should return
the same as list(m.groups()).) this would remove some of the verbosity
of regexp code, with
this one is fairly simple. if `m' is a match object, i'd like to be
able to write m[1] instead of m.group(1). (similarly, m[:] should return
the same as list(m.groups()).) this would remove some of the verbosity
of regexp code, with probably a net gain in readability; certainly no loss.
ben
many times writing somewhat complex loops over lists i've found the need
to sometimes delete an item from the list. currently there's no easy
way to do so; basically, you have to write something like
i = 0
while i < len(list):
el = list[i]
...do something...
if el should be deleted:
de
recently i've been writing code that generates a python program from a
source file containing intermixed python code and non-python constructs,
which get converted into python.
similar things have been done in many other languages -- consider, for
example, the way php is embedded into web pages
Nick Coghlan wrote:
> Ben Wing wrote:
>
>> apologies if this has been brought up on python-dev already.
>>
>> a suggestion i have, perhaps for python 3.0 since it may break some
>> code (but imo it could go into 2.6 or 2.7 because the likely breakage
>> wou
apologies if this has been brought up on python-dev already.
a suggestion i have, perhaps for python 3.0 since it may break some code
(but imo it could go into 2.6 or 2.7 because the likely breakage would
be very small, see below), is the elimination of the misfeature whereby
the iteration vari
15 matches
Mail list logo