Re: Difference between unindexable and unsubscriptable

2006-10-10 Thread Theerasak Photha
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

Re: Difference between unindexable and unsubscriptable

2006-10-10 Thread Ben Finney
"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

Re: Difference between unindexable and unsubscriptable

2006-10-10 Thread Theerasak Photha
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

Re: Difference between unindexable and unsubscriptable

2006-10-10 Thread Ben Finney
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]

Re: Difference between unindexable and unsubscriptable

2006-10-10 Thread Fredrik Lundh
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

Difference between unindexable and unsubscriptable

2006-10-10 Thread Jackson
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