Re: Newbie look at Python and OO



Nevermind my previous question. I found the answer in "Learning
Python"


Python internally caches and reuses short strings as an optimization,
there really is just a single string, 'spam', in memory, shared by S1
and S2; hence, the is identity test reports a true result. To trigger
the normal behavior, we need to use longer strings that fall outside
the cache mechanism:
<<


.



Relevant Pages

  • Re: How to read file in nonblocking mode?
    ... What are "difference files"? ... open(my $JobFile, $JobFileLocation); ... if you want to read a lot of data into memory as a single string ...
    (comp.lang.perl.misc)
  • Regex. How to return multiple lines
    ... newline char. ... I assume that file would be read in one chunk into memory. ... operating on single string would be faster. ...
    (comp.lang.ruby)
  • Re: Time to re-think alternation of im?
    ... have to think about what your legs are doing if you were learning to ... I don't recall ever saying anything that would be contrary to this nor did I feel the need to say that learning to dance like Gene Kelly would require attention to your legs. ... mostly I'll lead with my "a" when playing on a single string or switching to a new string - a fact that I was completely unaware of until I bothered to check - that surprises me. ...
    (rec.music.classical.guitar)
  • Re: Read large text files
    ... If so, ReadToEnd is probably okay. ... from a memory perspective. ... Prev by Date: ...
    (microsoft.public.dotnet.framework)
  • Re: Smart way to delete the first row of a huge file
    ... Your code requires to load the whole ... 200MB file into memory in one go. ... Actually can a single string contain ... or filenum? ...
    (microsoft.public.excel.programming)