Re: string slicing

2004-12-05 Thread Carlos Ribeiro
On Sun, 5 Dec 2004 17:07:47 +0100, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > a suggestion: if you really want to be productive in python, forget about > "is" for a while. good code doesn't copy stuff much, either, by the way. > python's all about objects, and things that hold references to object

Re: string slicing

2004-12-05 Thread Ishwor
I didn't mean to be extremely rude. Just a little bit..~:-). sorry. On Sun, 05 Dec 2004 12:09:22 -0800, Josiah Carlson <[EMAIL PROTECTED]> wrote: > [snip] > > Goodness, you got right snippy with the 'intellectual property' thing. > I'm sorry if it sounded as if I had meant "I came up with this

Re: string slicing

2004-12-05 Thread Josiah Carlson
Ishwor <[EMAIL PROTECTED]> wrote: > > On Sun, 05 Dec 2004 10:31:12 -0800, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > > > "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > > > > a suggestion: if you really want to be productive in python, forget about > > > "is" for a while. > > I know what Fredr

Re: string slicing

2004-12-05 Thread Ishwor
On Sun, 05 Dec 2004 10:31:12 -0800, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > > a suggestion: if you really want to be productive in python, forget about > > "is" for a while. I know what Fredrik means here (Thanx Frederick :) ) but IMHO if the pa

Re: string slicing

2004-12-05 Thread Josiah Carlson
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > > Ishwor wrote: > > > I am trying some interactive examples here where i have come across > > inconsistencies??? :O > > obsession with implementation artifacts is a premature optimization, > and should be avoided. [snip] > a suggestion: if you rea

Re: string slicing

2004-12-05 Thread Fredrik Lundh
Ishwor wrote: > I am trying some interactive examples here where i have come across > inconsistencies??? :O obsession with implementation artifacts is a premature optimization, and should be avoided. > Anyway heres whats bothering me > s = 'hello' s[0] > 'h' s[:] > 'hello' m

Re: string slicing

2004-12-05 Thread Kent Johnson
Ishwor wrote: On Sun, 05 Dec 2004 09:44:13 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote: This behaviour is due to the way strings are handled. In some cases strings are 'interned' which lets the interpreter keep only a single copy of a string. If you try it with a list you get a different result

Re: string slicing

2004-12-05 Thread Ishwor
On Sun, 05 Dec 2004 09:44:13 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote: [snip] > > This behaviour is due to the way strings are handled. In some cases strings > are 'interned' which > lets the interpreter keep only a single copy of a string. If you try it with > a list you get a > differen

Re: string slicing

2004-12-05 Thread Kent Johnson
Ishwor wrote: s = 'hello' m = s[:] m is s True I discussed the *is* operator with some of the pythoners before as well but it is somewhat different than what i intended it to do. The LP2E by Mark & David says - " m gets a *full top-level copy* of a sequence object- an object with the same value bu