En Thu, 08 Mar 2007 13:13:23 -0300, Alan Franzoni
<[EMAIL PROTECTED]> escribió:
> this
> container does create a copy of the object even employing incremental
> operators.
>
> Now, let's suppose I find that container type not useful for my purposes,
> *or* I have already written a different cont
Il Wed, 07 Mar 2007 14:13:28 -0300, Gabriel Genellina ha scritto:
> __iadd__, in general, is not *required* to modify the instance in place
> (but should try to do that, if possible). After this code:
> b = a
> a += c
> you can't assert than a and b both refer to the *same* object, a
En Wed, 07 Mar 2007 10:29:29 -0300, Alan Franzoni
<[EMAIL PROTECTED]> escribió:
> Il Tue, 06 Mar 2007 01:55:54 -0300, Gabriel Genellina ha scritto:
> If we rely on duck typing, by the way, we may encounter two types
> quacking
> like ducks, flying like ducks, but in fact acting as slightly di
Il Tue, 06 Mar 2007 01:55:54 -0300, Gabriel Genellina ha scritto:
> The problem is that other people -not necesarily "smarter and more
> experienced" than you- may use those features, and perhaps you have to
> read, understand and modify some code written by someone else.
> So, you should at
En Mon, 05 Mar 2007 07:07:57 -0300, Alan Franzoni
<[EMAIL PROTECTED]> escribió:
> Il Sat, 03 Mar 2007 17:34:35 +1300, greg ha scritto:
>
>> This was all discussed at *very* great length many
>> years ago, and the addition of in-place operators
>> to the language was held up for a long time until
On 2 Mar, 14:45, Alan Franzoni <[EMAIL PROTECTED]>
wrote:
>
> I mean... I don't like that. I'm not really a Python expert, I found this
> behaviour is documented in the language reference itself:
>
> http://docs.python.org/ref/augassign.html
>
> But... I don't know, still think it's confusing and n
Il Sat, 03 Mar 2007 17:34:35 +1300, greg ha scritto:
> This was all discussed at *very* great length many
> years ago, and the addition of in-place operators
> to the language was held up for a long time until
> the present compromise was devised. You might not
> like it, but it's here to stay.
S
Alan Franzoni wrote:
> I would assume then, that if the '+=' operator
> is assumed to modify objects in-place, it would just fail on immutable
> objects, wouldn't I?
Then you wouldn't be able to do things like
x = 3
x += 1
which would result in howls of outrage from the
*other* half of t
Il 28 Feb 2007 14:09:09 -0800, [EMAIL PROTECTED] ha scritto:
> Seems obvious and desirable to me. Bare "=" is the way you assign a
> name to an object; saying "NAME =" will rebind the name, breaking the
> connection between a and b. Without it, they continue to refer to the
> same object; exten
En Wed, 28 Feb 2007 19:09:09 -0300, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> escribió:
> On Feb 28, 11:24 am, Alan Franzoni
> <[EMAIL PROTECTED]> wrote:
>> Il 27 Feb 2007 16:14:20 -0800, [EMAIL PROTECTED] ha scritto:
>>
>> > Those mean different things:
>>
>> a=[1]
>> b=a
>> a += [2]
Hello,
thanks.
pythontidy (with maybe some patches could be useful)
not directly related but:
pyflakes looks quite interesting too.
and I try out (again) pylint and pychecker or a combination
of these could bring good results, I assume. ;)
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 28, 11:24 am, Alan Franzoni
<[EMAIL PROTECTED]> wrote:
> Il 27 Feb 2007 16:14:20 -0800, [EMAIL PROTECTED] ha scritto:
>
>
>
> > Those mean different things:
>
> a=[1]
> b=a
> a += [2]
> a
> > [1, 2]
> b
> > [1, 2]
> a=[1]
> b=a
> a = a + [2]
> a
>
Alan Franzoni wrote:
> Yeah, that's right, it could have semantic differences, but that
> shouldn't be the case anyway. I mean, if I don't define an __iadd__
> method, writing
>
> a += n
>
> or
>
> a = a + n
>
> is just the same, right?
>
> So, if I bother to define an __iadd__ method, I sho
Alan Franzoni <[EMAIL PROTECTED]> wrote:
> Yeah, that's right, it could have semantic differences, but that
> shouldn't be the case anyway. I mean, if I don't define an __iadd__
> method, writing
>
> a += n
>
> or
>
> a = a + n
>
> is just the same, right?
>
>
> So, if I bother to define an
Il 27 Feb 2007 16:14:20 -0800, [EMAIL PROTECTED] ha scritto:
> Those mean different things:
>
a=[1]
b=a
a += [2]
a
> [1, 2]
b
> [1, 2]
a=[1]
b=a
a = a + [2]
a
> [1, 2]
b
> [1]
This is a really nasty one! I just answered to Tim above here, and the
Il Wed, 28 Feb 2007 07:53:47 +1100, Delaney, Timothy (Tim) ha scritto:
> Alan Franzoni wrote:
>> the += operator is syntactic sugar just to save time... if one
>> doesn't use it I don't think it's a matter of beauty.
>
> This change can have semantic differences, and so should not be done for
> a
On Feb 27, 3:45 am, Franz Steinhaeusler <[EMAIL PROTECTED]>
wrote:
> Hello, I did not find any reasonable pyhton source code beautifier
> program (preferable gui).
>
> Some would ask why? Program it immediatly good.
>
> (BTW: Would be a nice project, if I would have more spare time).
>
> Ich have s
Alan Franzoni wrote:
>> self.scriptcount = self.scriptcount + 1 => self.scriptcount += 1
>
> the += operator is syntactic sugar just to save time... if one
> doesn't use it I don't think it's a matter of beauty.
This change can have semantic differences, and so should not be done for
anything ex
Franz Steinhaeusler wrote:
> Use Spaces, size: 4
> detect mixed line ending
> detect tabs mixed with space
> trim trailing whitespaces.
look at: tools/scripts/reindent.py
> convert structs like: if (a > b): to if a > b:
> fill in spaces, but not in functions between operators:
>
> a+=1 =>
Il Tue, 27 Feb 2007 09:45:42 +0100, Franz Steinhaeusler ha scritto:
> Hello, I did not find any reasonable pyhton source code beautifier
> program (preferable gui).
Well, most of the things you ask should be written as such, not written and
then beautified!
> Use Spaces, size: 4
Your editor sho
Franz Steinhaeusler wrote this on Tue, 27 Feb 2007 09:45:42 +0100. My
reply is below.
> Hello, I did not find any reasonable pyhton source code beautifier
> program (preferable gui).
-snip-
> Is there such a tool around?
Why, yes! Yes, there is:
o http://lacusveris.com/PythonTidy/PythonTidy.
Franz Steinhaeusler:
> Hello, I did not find any reasonable pyhton source code beautifier
> program (preferable gui).
> ...
> convert:
> ...
> from "is" to "==" and "is not" to "!=" (ok a find replace could do that
> easily also), but in a program that would be more comfortable.
That's an unsa
22 matches
Mail list logo