On Mon, 03 May 2010 06:37:49 +0200, Alf P. Steinbach wrote:
* Terry Reedy:
* Alf P. Steinbach:
* Aahz:
and sometimes
they rebind the original target to the same object.
At the Python level that seems to be an undetectable null-operation.
If you try t=(1,2,3); t[1]+=3, if very much
Alf P. Steinbach wrote:
test lang=py3
t = ([], [], [])
t
([], [], [])
t[0] += [blah]
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: 'tuple' object does not support item assignment
t
(['blah'], [], [])
_
/test
Yep, it matters.
Is this
On 5/3/2010 12:37 AM, Alf P. Steinbach wrote:
* Terry Reedy:
* Alf P. Steinbach:
* Aahz:
and sometimes
they rebind the original target to the same object.
At the Python level that seems to be an undetectable null-operation.
If you try t=(1,2,3); t[1]+=3, if very much matters that a
On 05/02/10 10:58, Steven D'Aprano wrote:
And Python's object system
makes it that the argument to __getattr__ is always a string even though
there might be a valid variable that corresponds to it:
That is nothing to do with the object system, it is related to the
semantics of Python
On 05/02/10 10:58, Steven D'Aprano wrote:
On Sun, 02 May 2010 05:08:53 +1000, Lie Ryan wrote:
On 05/01/10 11:16, Steven D'Aprano wrote:
On Fri, 30 Apr 2010 12:34:34 -0400, D'Arcy J.M. Cain wrote:
In practice though, I think that's a difference that makes no
difference. It walks like
On 5/2/2010 1:05 AM, Alf P. Steinbach wrote:
On 02.05.2010 06:06, * Aahz:
and sometimes
they rebind the original target to the same object.
At the Python level that seems to be an undetectable null-operation.
If you try t=(1,2,3); t[1]+=3, if very much matters that a rebind occurs.
On Sun, 02 May 2010 16:28:28 +1000, Lie Ryan wrote:
On 05/02/10 10:58, Steven D'Aprano wrote:
And Python's object system
makes it that the argument to __getattr__ is always a string even
though there might be a valid variable that corresponds to it:
That is nothing to do with the object
On Sun, 02 May 2010 17:09:36 +1000, Lie Ryan wrote:
On 05/02/10 10:58, Steven D'Aprano wrote:
On Sun, 02 May 2010 05:08:53 +1000, Lie Ryan wrote:
On 05/01/10 11:16, Steven D'Aprano wrote:
On Fri, 30 Apr 2010 12:34:34 -0400, D'Arcy J.M. Cain wrote:
In practice though, I think that's a
On Sun, 02 May 2010 04:04:11 -0400, Terry Reedy wrote:
On 5/2/2010 1:05 AM, Alf P. Steinbach wrote:
On 02.05.2010 06:06, * Aahz:
and sometimes
they rebind the original target to the same object.
At the Python level that seems to be an undetectable null-operation.
If you try t=(1,2,3);
In article mailman.2429.1272646255.23598.python-l...@python.org,
Jean-Michel Pichavant jeanmic...@sequans.com wrote:
Jabapyth wrote:
At least a few times a day I wish python had the following shortcut
syntax:
vbl.=func(args)
this would be equivalent to
vbl = vbl.func(args)
example:
* Terry Reedy:
* Alf P. Steinbach:
* Aahz:
and sometimes
they rebind the original target to the same object.
At the Python level that seems to be an undetectable null-operation.
If you try t=(1,2,3); t[1]+=3, if very much matters that a rebind occurs.
Testing:
test lang=py3
t = ([],
Hay I got a better idea. If you put two dots (..) on a line by itself it
means
execute the previous line again!
On 1 May 2010 07:08, Patrick Maupin pmau...@gmail.com wrote:
On Apr 30, 11:04 am, Jabapyth jabap...@gmail.com wrote:
At least a few times a day I wish python had the following
On 05/01/2010 12:08 AM, Patrick Maupin wrote:
+=, -=, /=, *=, etc. conceptually (and, if lhs object supports in-
place operator methods, actually) *modify* the lhs object.
Your proposed .= syntax conceptually *replaces* the lhs object
(actually, rebinds the lhs symbol to the new object).
The
Tim Chase, 01.05.2010 14:13:
On 05/01/2010 12:08 AM, Patrick Maupin wrote:
+=, -=, /=, *=, etc. conceptually (and, if lhs object supports in-
place operator methods, actually) *modify* the lhs object.
Your proposed .= syntax conceptually *replaces* the lhs object
(actually, rebinds the lhs
On 01.05.2010 14:13, * Tim Chase:
On 05/01/2010 12:08 AM, Patrick Maupin wrote:
+=, -=, /=, *=, etc. conceptually (and, if lhs object supports in-
place operator methods, actually) *modify* the lhs object.
Your proposed .= syntax conceptually *replaces* the lhs object
(actually, rebinds the
On 05/01/10 11:16, Steven D'Aprano wrote:
On Fri, 30 Apr 2010 12:34:34 -0400, D'Arcy J.M. Cain wrote:
In practice though, I think that's a difference that makes no difference.
It walks like an operator, it swims like an operator, and it quacks like
an operator.
Nope it's not. A
On May 1, 7:13 am, Tim Chase t...@thechases.com wrote:
On 05/01/2010 12:08 AM, Patrick Maupin wrote:
+=, -=, /=, *=, etc. conceptually (and, if lhs object supports in-
place operator methods, actually) *modify* the lhs object.
Your proposed .= syntax conceptually *replaces* the lhs
On Sun, 02 May 2010 05:08:53 +1000
Lie Ryan lie.1...@gmail.com wrote:
On 05/01/10 11:16, Steven D'Aprano wrote:
On Fri, 30 Apr 2010 12:34:34 -0400, D'Arcy J.M. Cain wrote:
In practice though, I think that's a difference that makes no difference.
It walks like an operator, it swims like
On Sun, 02 May 2010 05:08:53 +1000, Lie Ryan wrote:
On 05/01/10 11:16, Steven D'Aprano wrote:
On Fri, 30 Apr 2010 12:34:34 -0400, D'Arcy J.M. Cain wrote:
In practice though, I think that's a difference that makes no
difference. It walks like an operator, it swims like an operator, and
it
On Sat, 01 May 2010 07:13:42 -0500, Tim Chase wrote:
On 05/01/2010 12:08 AM, Patrick Maupin wrote:
+=, -=, /=, *=, etc. conceptually (and, if lhs object supports in-
place operator methods, actually) *modify* the lhs object.
Your proposed .= syntax conceptually *replaces* the lhs object
On Sat, May 1, 2010 at 6:32 PM, Steven D'Aprano
st...@remove-this-cybersource.com.au wrote:
On Sat, 01 May 2010 07:13:42 -0500, Tim Chase wrote:
This doesn't preclude you from implementing a self-mutating += style
__add__ method and returning self, but it's usually a bad idea
Obviously the
On Sat, 01 May 2010 19:03:04 -0700, Chris Rebert wrote:
On Sat, May 1, 2010 at 6:32 PM, Steven D'Aprano
st...@remove-this-cybersource.com.au wrote:
On Sat, 01 May 2010 07:13:42 -0500, Tim Chase wrote:
This doesn't preclude you from implementing a self-mutating += style
__add__ method and
On May 1, 9:03 pm, Chris Rebert c...@rebertia.com wrote:
In both cases, __iOP__ operator methods are being used, not vanilla
__OP__ methods, so neither of your examples are relevant to Mr.
Chase's point.
Well, Tim's main assertion was: The += family of operators really do
rebind the symbol,
In article 4bdcd631$0$27782$c3e8...@news.astraweb.com,
Steven D'Aprano st...@remove-this-cybersource.com.au wrote:
On Sat, 01 May 2010 07:13:42 -0500, Tim Chase wrote:
The += family of operators really do rebind the symbol, not modify the
object.
They potentially do both, depending on the
On 02.05.2010 06:06, * Aahz:
In article4bdcd631$0$27782$c3e8...@news.astraweb.com,
Steven D'Apranost...@remove-this-cybersource.com.au wrote:
On Sat, 01 May 2010 07:13:42 -0500, Tim Chase wrote:
The += family of operators really do rebind the symbol, not modify the
object.
They potentially
On Sat, May 1, 2010 at 10:05 PM, Alf P. Steinbach al...@start.no wrote:
On 02.05.2010 06:06, * Aahz:
In article4bdcd631$0$27782$c3e8...@news.astraweb.com,
Steven D'Apranost...@remove-this-cybersource.com.au wrote:
On Sat, 01 May 2010 07:13:42 -0500, Tim Chase wrote:
The += family of
At least a few times a day I wish python had the following shortcut
syntax:
vbl.=func(args)
this would be equivalent to
vbl = vbl.func(args)
example:
foo = Hello world
foo.=split( )
print foo
# ['Hello', 'world']
and I guess you could generalize this to
vbl.=[some text]
#
vbl = vbl.[some
That's kind of a nifty idea. However, python is currently under a
syntax moratorium. No syntax changes will be accepted for at least 24
months starting from the release date of Python 3.1. See more details
here: http://www.python.org/dev/peps/pep-3003/
Cheers,
Cliff
On Fri, 2010-04-30 at
J. Cliff Dyer, 30.04.2010 18:20:
On Fri, 2010-04-30 at 09:04 -0700, Jabapyth wrote:
At least a few times a day I wish python had the following shortcut
syntax:
vbl.=func(args)
this would be equivalent to
vbl = vbl.func(args)
example:
foo = Hello world
foo.=split( )
print foo
# ['Hello',
On Fri, 30 Apr 2010 09:04:59 -0700 (PDT)
Jabapyth jabap...@gmail.com wrote:
foo = Hello world
foo.=split( )
Isn't;
foo = Hello world
bar = foo.split() # side note - split() splits on whitespace by default
so much clearer? Do you really want to see Python turn into Perl?
However, if you
Jabapyth wrote:
At least a few times a day I wish python had the following shortcut
syntax:
vbl.=func(args)
this would be equivalent to
vbl = vbl.func(args)
example:
foo = Hello world
foo.=split( )
print foo
# ['Hello', 'world']
Extending a language comes at a cost, too. A
Jabapyth wrote:
At least a few times a day I wish python had the following shortcut
syntax:
vbl.=func(args)
this would be equivalent to
vbl = vbl.func(args)
example:
foo = Hello world
foo.=split( )
print foo
# ['Hello', 'world']
and I guess you could generalize this to
vbl.=[some text]
#
D'Arcy J.M. Cain da...@druid.net writes:
On Fri, 30 Apr 2010 09:04:59 -0700 (PDT)
Jabapyth jabap...@gmail.com wrote:
foo = Hello world
foo.=split( )
Isn't;
foo = Hello world
bar = foo.split() # side note - split() splits on whitespace by default
so much clearer? Do you really want to
On Fri, Apr 30, 2010 at 10:05 AM, John Bokma j...@castleamber.com wrote:
D'Arcy J.M. Cain da...@druid.net writes:
On Fri, 30 Apr 2010 09:04:59 -0700 (PDT)
Jabapyth jabap...@gmail.com wrote:
foo = Hello world
foo.=split( )
Isn't;
foo = Hello world
bar = foo.split() # side note - split()
On Fri, 30 Apr 2010 12:05:49 -0500
John Bokma j...@castleamber.com wrote:
D'Arcy J.M. Cain da...@druid.net writes:
so much clearer? Do you really want to see Python turn into Perl?
Oh, boy, there we go again. Can you and your buddies please refrain from
using Perl as a kind of
On 05/01/10 02:50, Jean-Michel Pichavant wrote:
Jabapyth wrote:
At least a few times a day I wish python had the following shortcut
syntax:
snip
currentCar = Car()
currentCar = currentCar.nextCar
The syntax you prose will be applicable on very little assignements (use
case 3). I'm not
Chris Rebert c...@rebertia.com writes:
On Fri, Apr 30, 2010 at 10:05 AM, John Bokma j...@castleamber.com wrote:
[..]
On top of that, it's not possible in Perl (heh, no surprise there). The
only thing that comes close is:
Actually/ironically, it does appear to be in Perl 6:
Mutating
In article 87zl0klvki@castleamber.com,
John Bokma j...@castleamber.com wrote:
Why I am asking this is that most Oh, like Perl statements I've seen
the past months were made by people who either haven't used Perl
themselves or have very little skill in the language.
What evidence do you
On Apr 30, 9:04 am, Jabapyth jabap...@gmail.com wrote:
At least a few times a day I wish python had the following shortcut
syntax:
vbl.=func(args)
this would be equivalent to
vbl = vbl.func(args)
example:
foo = Hello world
foo.=split( )
print foo
# ['Hello', 'world']
and I guess
On Fri, 30 Apr 2010 18:50:46 +0200, Jean-Michel Pichavant wrote:
Jabapyth wrote:
At least a few times a day I wish python had the following shortcut
syntax:
vbl.=func(args)
this would be equivalent to
vbl = vbl.func(args)
[...]
Useless if you use meaningful names for your variables
On Fri, 30 Apr 2010 12:34:34 -0400, D'Arcy J.M. Cain wrote:
I assume you mean the former to be analagous to += and friends but I
am not sure since . isn't an operator.
It's a de facto operator. If you google on python dot operator you will
find many people who refer to it as such, and
On Apr 30, 11:04 am, Jabapyth jabap...@gmail.com wrote:
At least a few times a day I wish python had the following shortcut
syntax:
vbl.=func(args)
this would be equivalent to
vbl = vbl.func(args)
example:
foo = Hello world
foo.=split( )
print foo
# ['Hello', 'world']
and I guess
42 matches
Mail list logo