On 10/24/2010 11:42 PM, Chris Rebert wrote:
On Sun, Oct 24, 2010 at 4:11 PM, James Mills
wrote:
On Mon, Oct 25, 2010 at 9:02 AM, Chris Rebert wrote:
Method chaining is usually* not idiomatic in Python.
I don't agree but anyway... I've just not seen it commonly used
amongst python programme
Hi Steve and others,
On 2010-10-25 06:08, Steve Holden wrote:
> On 10/24/2010 11:42 PM, Chris Rebert wrote:
>> On Sun, Oct 24, 2010 at 4:11 PM, James Mills
>> wrote:
>>> I don't agree but anyway... I've just not seen it commonly used
>>> amongst python programmers.
>>
>> If Python wanted to encou
On 10/24/2010 11:42 PM, Chris Rebert wrote:
> On Sun, Oct 24, 2010 at 4:11 PM, James Mills
> wrote:
>> On Mon, Oct 25, 2010 at 9:02 AM, Chris Rebert wrote:
>>> Method chaining is usually* not idiomatic in Python.
>>
>> I don't agree but anyway... I've just not seen it commonly used
>> amongst pyt
On Sun, Oct 24, 2010 at 4:11 PM, James Mills
wrote:
> On Mon, Oct 25, 2010 at 9:02 AM, Chris Rebert wrote:
>> Method chaining is usually* not idiomatic in Python.
>
> I don't agree but anyway... I've just not seen it commonly used
> amongst python programmers.
If Python wanted to encourage metho
On Mon, Oct 25, 2010 at 9:39 AM, James Mills
wrote:
> Function/Method Chaining is probably used a lot in Python itself:
>
x = 4
x.__add__(1).__sub__(3)
> 2
>
> The implementation of many common operators return self (the object
> you're working with).
My apologies, this was a terribly e
On Mon, Oct 25, 2010 at 12:49 PM, Steven D'Aprano
wrote:
> ...if you're writing x.__add__(1).__sub__(3) instead of x + 1 - 3 then
> you're almost certainly doing it wrong.
It was just an example :) ... And this isn't python-tutor
--James
--
-- James Mills
--
-- "Problems are solved by method"
On Mon, 25 Oct 2010 09:39:47 +1000, James Mills wrote:
> On Mon, Oct 25, 2010 at 9:21 AM, chad wrote:
>> I just saw this technique used in python script that was/is used to
>> automatically log them in myspace.com. Hence the question.
>
> Function/Method Chaining is probably used a lot in Python
On 10/24/2010 7:39 PM, James Mills wrote:
> On Mon, Oct 25, 2010 at 9:21 AM, chad wrote:
>> I just saw this technique used in python script that was/is used to
>> automatically log them in myspace.com. Hence the question.
>
> Function/Method Chaining is probably used a lot in Python itself:
>
>>
On Mon, Oct 25, 2010 at 9:21 AM, chad wrote:
> I just saw this technique used in python script that was/is used to
> automatically log them in myspace.com. Hence the question.
Function/Method Chaining is probably used a lot in Python itself:
>>> x = 4
>>> x.__add__(1).__sub__(3)
2
The implement
On Oct 24, 4:11 pm, James Mills wrote:
> On Mon, Oct 25, 2010 at 9:02 AM, Chris Rebert wrote:
> > Method chaining is usually* not idiomatic in Python.
>
> I don't agree but anyway... I've just not seen it commonly used
> amongst python programmers.
>
> cheers
> James
>
I just saw this technique
On Mon, Oct 25, 2010 at 9:02 AM, Chris Rebert wrote:
> Method chaining is usually* not idiomatic in Python.
I don't agree but anyway... I've just not seen it commonly used
amongst python programmers.
cheers
James
--
-- James Mills
--
-- "Problems are solved by method"
--
http://mail.python.or
On Mon, Oct 25, 2010 at 8:47 AM, chad wrote:
> I tried the following...
>
>
>
> #!/usr/bin/python
>
> class foo:
> def first(self):
> print "Chad "
>
> def last(self):
> print "A "
>
> x = foo()
> y = x.first()
> y.last()
>
> But when I ran it, I got the following...
>
> [cdal.
On Sun, Oct 24, 2010 at 3:47 PM, chad wrote:
> How do I chain methods?
> I tried the following...
>
> #!/usr/bin/python
>
> class foo:
> def first(self):
> print "Chad "
>
> def last(self):
> print "A "
>
> x = foo()
I tried the following...
#!/usr/bin/python
class foo:
def first(self):
print "Chad "
def last(self):
print "A "
x = foo()
y = x.first()
y.last()
But when I ran it, I got the following...
[cdal...@localhost oakland]$ ./chain.py
Chad
Traceback (most recent call last):
14 matches
Mail list logo