[Chicago] duck typing to handle a string or iterable of strings

Michael Tobis mtobis at gmail.com
Fri May 20 18:51:18 CEST 2011


John,  thanks, but that's sort of what I meant by punting. And you
haven't told us what is_string_like() looks like.

In short, something as fundamental as a character probably shouldn't
have been implemented as a container containing itself.

>>> a = []
>>> a.append(a)
>>> a
[ [ ... ] ]

a is a pretty weird object which will kill your flatten routine in the
same way that "X" will kill mine. In the end it's sort of a quibble
but I am not entirely happy that "X" has this bottomless nature and
that I lost some time figuring that out.

mt


More information about the Chicago mailing list