A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-October/017759.html below:

[Python-Dev] Need a way to test for 8-bit-or-unicode-string

[Python-Dev] Need a way to test for 8-bit-or-unicode-string [Python-Dev] Need a way to test for 8-bit-or-unicode-stringGuido van Rossum guido@python.org
Fri, 05 Oct 2001 11:20:30 -0400
> Guido van Rossum wrote:
> > 
> >     if isinstance(x, str) or isinstance(x, unicode):
> > 
> > is apparently too much typing.
> 
> Perhaps we could extend isinstance().  How about
> 
>     isinstance(x, str, unicode)
> 
> or
> 
>     isinstance(x, (str, unicode))
> 
> This is a common problem not limited to string types.  I often want to
> test if something is a tuple or a list for example.

You may be on to something.  It certainly saves me inventing a new
name!  I'll think about it a bit more...

--Guido van Rossum (home page: http://www.python.org/~guido/)



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