GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • [Python-Dev] Slice as a copy... by design?
  • [Python-Dev] Slice as a copy... by design?
  • [ date ]
  • [ thread ]
  • [ subject ]
  • [ author ]

This view

  • Original page
  • New address

GeezerVison is showing mail.python.org — [Python-Dev] Slice as a copy... by design?

[Python-Dev] Slice as a copy... by design?

Facundo Batista facundobatista at gmail.com
Thu May 22 18:34:56 CEST 2008

  • Previous message: [Python-Dev] Slice as a copy... by design?
  • Next message: [Python-Dev] Slice as a copy... by design?
  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

2008/5/22 Isaac Morland <ijmorlan at cs.uwaterloo.ca>:

> By contrast, the worst that can happen with no sharing is that performance
> and memory use is what you expect - the only "bad" is the apparent missed
> opportunity for optimization.

Exactly, "apparent".

Also, this could be handled like a "good writing tip". For example,
right now everybody knows that appending a letter to a string a
zillion times is not efficient, you should store them in a list, and
then .join() them.

Similarly, we could know that slicing zillions of long lines and
keeping small portion of them is not memory efficient, you should do
everytime "shortstring = str(longstring[:2])", for example. Note that
this "special coding" will be for an "special case"... in your normal
life the code just will be more efficient...

Regards,

-- 
. Facundo

Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/

  • Previous message: [Python-Dev] Slice as a copy... by design?
  • Next message: [Python-Dev] Slice as a copy... by design?
  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

More information about the Python-Dev mailing list
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.