How to know it is a list?

Cliff Wells logiplexsoftware at earthlink.net
Mon Sep 10 19:53:57 EDT 2001


On Monday 10 September 2001 15:20, David Bolen wrote:
> "Henry" <ht_xu at hotrmail.com> writes:

> For example, if you have code that assumes it is going to append a new
> element to a list, it'll probably be using the "append" method.  So
> you might consider verifying that you have been passed a list before
> performing the append.  But if you do that, then if someone tries to
> pass you another object (that also happens to implement an append
> method) you'll refuse to work when you would actually work just fine.

This is excellent advice.  Thanks.

-- 
Cliff Wells
Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 x308
(800) 735-0555 x308




More information about the Python-list mailing list