[Tim] > 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. [/F] > 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 ;-) Yes, it's nice code! The irony was the source of my "curiously" <wink>. > how about an "expandtabslength" method? Na, it's very specialized, easy to spell by hand, and even IDLE/pyclbr don't really need more speed in this area.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4