[Python-Dev] String methods... finally

Fredrik Lundh fredrik at pythonware.com
Sat Jun 12 11:31:08 CEST 1999


> expandtabs is used frequently in IDLE and even pyclbr.py now.  Curiously,
> though, they almost never want the tab-expanded string, but rather its len.

looked in stropmodule.c lately:

static PyObject *
strop_expandtabs(self, args)
...
 /* First pass: determine size of output string */
...
 /* Second pass: create output string and fill it */
...

(btw, I originally wrote that code for pythonworks ;-)

how about an "expandtabslength" method?

or maybe we should add lazy evaluation of strings!

</F>





More information about the Python-Dev mailing list