Re: Rev() with better repr [and complaint about pedantic typechecking]
Fri, 29 Oct 1993 11:20:59 +0100
> WHICH brings up the need for building a list of values for joinfields
> which doen't work on a pseudo sequence object:
> >>>joinfields( Rev( string.split( 'This is a test' )), ':::' )
> Stack backtrace (innermost last):
> File "<stdin>", line 1
> TypeError: first argument must be list/tuple
> Unnecessarily pedantic typechecking ?
> Not in string.py (as far as I can tell). It must be from the internal
> strop version. Is there any way to import the joinfields from
> string.py over the one in strop module ? ( Or is the solution
> to fix strop's joinfields ? )
strop.joinfields should be fixed (and it appears not too difficult).
If you don't want the strop version, you'll have to copy string.py to
string_in_python.py, take the strop reference out, and use that...
However, note that in general updating all built-in functions that
currently only take lists and/or tuples as arguments might prove a
major undertaking... There is much more to check and the reference
count handling is different... Some time... When I retire...
--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>