ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-list
python-list
Re: c[:]()
by Erik Max Francis other posts by this author
May 31 2007 11:30PM messages near this date
Re: c[:]() | RE: c[:]()
Warren Stringer wrote:

>  `c[:]()` is unambiguous because:
>  
>      def c(): print 'yo'
>  
>      c()     # works, but
>      c[:]()  # causes:
>  
>      Traceback (most recent call last)...
>          c[:]()  # causes:
>      TypeError: unsubscriptable object
>  
>  There are many `c()` to be found in the wild and no `c[:]()`, thus
>  unambiguous. To be honest, I wasn't sure, until testing this, just now.

 > >> c = 'not quite'
 > >> c[:]
'not quite'
 > >> c[:]()
Traceback (most recent call last):
   File "<stdin> ", line 1, in ?
TypeError: 'str' object is not callable

You also seem to be under the impression that `x[:]()` is somehow 
special syntax that is treated differently than `y = x[:]; y()`.  It is not.

Besides, _ambiguity_ was never the problem.  _Functionality_ is the problem.

-- 
Erik Max Francis && max@[...].com && http://www.alcyone.com/max/
  San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
   To endure what is unendurable is true endurance.
    -- (a Japanese proverb)
-- 
http://mail.python.org/mailman/listinfo/python-list
Thread:
BlueJ774
Erik Max Francis
BlueJ774
Warren Stringer
Dackz
Warren Stringer
Mikael Olofsson
Erik Max Francis
Warren Stringer
Erik Max Francis
Warren Stringer
Carsten Haese
Carsten Haese
Grant Edwards
Grant Edwards
Warren Stringer
Erik Max Francis
Warren Stringer
Steve Holden
Warren Stringer
Grant Edwards
Douglas Woodrow
Grant Edwards
irstas
Steven D'Aprano
Warren Stringer
Grant Edwards
Warren Stringer
Grant Edwards
Steve Holden
Warren Stringer
Steve Holden
Warren Stringer
Steve Holden
Warren Stringer
Jerry Hill
Grant Edwards
Warren Stringer
Alan Franzoni
Tijs
Marc 'BlackJack' Rintsch
Warren Stringer
Douglas Woodrow
Warren Stringer
Douglas Woodrow
Duncan Booth
Carsten Haese
Dustan
Warren Stringer
Warren Stringer
irstas
William Hamilton
Warren Stringer
Brian van den Broek
Warren Stringer

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved