Iteration of strings

Bjarke Dahl Ebert bebert at tiscali.dk
Sat Nov 23 09:02:15 EST 2002


"Chad Netzer" <cnetzer at mail.arc.nasa.gov> wrote in message
news:mailman.1038008911.28064.python-list at python.org...

> Use an assertion in your function (or script):
>
> def dont_allow_string_argument( s ):
>     assert not isinstance( s, type("") )

Yes, I do that all of the time - when I remember it.
It would be nice with a kind of:

    from __options__ import nostringiteration

which should have effect in the global namespace into which it is
imported -- just like __future__ imports.


Bjarke







More information about the Python-list mailing list