Collections of non-arbitrary objects ?

7stud bbxx789_05ss at yahoo.com
Sat Jun 23 15:06:02 EDT 2007


On Jun 23, 11:45 am, walterbyrd <walterb... at iname.com> wrote:
> On Jun 22, 11:43 pm, Ben Finney <bignose+hates-s... at benfinney.id.au>
> wrote:
>
> > Can you help us understand, by showing a use case that would in your
> > estimation be improved by the feature you're describing?
>
> Suppose you are sequentially processing a list with a routine that
> expects every item to be of a certain type. Something in the list that
> doesn't conform to the type could give you unexpected results, maybe
> crash your application.
>

if hasattr(elmt, some_func):
   elmt.some_func()






More information about the Python-list mailing list