list Integer indexing dies??

Ishwor ishwor.gurung at gmail.com
Thu Dec 23 15:53:21 CET 2004


On Thu, 23 Dec 2004 11:40:12 -0300, Batista, Facundo
<FBatista at unifon.com.ar> wrote:
> 
> 
> [Ishwor] 
> 
> #- >>> 'invalid'[0] 
> #- 'i' 
> #- >>> 123232[-1] 
> #- # Python should automagically infer here that user 
> #- # means indexing and *not* the number per se. 
> #- # (i mean list in context of the line :-) ) 
> 
> Python never should automagically infer nothing! 
> 
> Type "import this" in the interactive interpreter and look at rule #2. 
> 
> 
It would be too much sometimes.. its like saying "do only as much as i
say and nothing much. If you are trying to give some gift to me, i
won't take it "
Anyway i'll go with import this's #2. 

> #- > IOW, the string is a sequence of characters, and the 
> #- integer is not sequence 
> #- > at all. 
> #- > 
> #- 
> #- strings are immutable sequence of collections in Python. Integers are 
> #- numbers. ;-) 
> 
> Nop. Strings are not a sequence of collections, just a sequence of
> characters. 

Sorry i'll rephrase it. strings are **immutable sequence** of
characters which fall under Collections type.  ;-)


-- 
cheers,
Ishwor Gurung



More information about the Python-list mailing list