On 10/11/06, Ben Finney <[EMAIL PROTECTED]> wrote:
> > I'm trying to learn about style conventions in Python. How would use
> > of getattr compare?
>
> I'm having trouble knowing what you need explained.
>
> You have available to you an interactive Python interpreter, and the
> documentation. Can
"Theerasak Photha" <[EMAIL PROTECTED]> writes:
> On 10/11/06, Ben Finney <[EMAIL PROTECTED]> wrote:
> > Jackson <[EMAIL PROTECTED]> writes:
> >
> > > I would like to test if an object can accept: obj[0]
> >
> > Then do so. Use the object in the way you want to use it, and catch
> > any exception
On 10/11/06, Ben Finney <[EMAIL PROTECTED]> wrote:
> Jackson <[EMAIL PROTECTED]> writes:
>
> > I would like to test if an object can accept: obj[0]
>
> Then do so. Use the object in the way you want to use it, and catch
> any exceptions that you want to handle.
I'm trying to learn about style co
Jackson <[EMAIL PROTECTED]> writes:
> I would like to test if an object can accept: obj[0]
Then do so. Use the object in the way you want to use it, and catch
any exceptions that you want to handle.
> >>> from sets import Set
> >>> Set([1,2])[0]
> TypeError: unindexable object
>
> >>> 3[0]
Jackson wrote:
> What is the difference between "object is unindexable" and "object is
> unsubscriptable"?
>
> I would like to test if an object can accept: obj[0]
>
> >>> from sets import Set
> >>> Set([1,2])[0]
> TypeError: unindexable object
>
> >>> 3[0]
> TypeError: unsubscriptable ob
What is the difference between "object is unindexable" and "object is
unsubscriptable"?
I would like to test if an object can accept: obj[0]
>>> from sets import Set
>>> Set([1,2])[0]
TypeError: unindexable object
>>> 3[0]
TypeError: unsubscriptable object
It seems like each of these erro