Re: How to determine an object is "scriptable"
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: How to determine an object is "scriptable"

From: abcd <codecraig@gmail.com>
Date: Thu Mar 30 2006 - 16:28:46 CEST

Daniel Evers wrote:
> Right. You can check this e.g. with
>
> hasattr(x, "__getitem__")
>
> because the __getitem__ method is used for indexing.

Thanks...that is what I was looking for!
Received on Sun Apr 30 21:40:24 2006