Thoughts on using isinstance

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Wed Jan 24 11:49:22 EST 2007


In <1169656371.689791.216360 at v33g2000cwv.googlegroups.com>, abcd wrote:

> Well my example function was simply taking a string and printing, but
> most of my cases would be expecting a list, dictionary or some other
> custom object.  Still propose not to validate the type of data being
> passed in?

Yes because usually you don't expect a list or dictionary but some object
that *acts* like a list or dictionary.  Or you even expect just some
aspects of the type's behavior.  For example that it is something you can
iterate over.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list