Crutcher Dunnavant wrote:
> On 4/4/06, Greg Ewing <[EMAIL PROTECTED]> wrote:
>> Crutcher Dunnavant wrote:
>>> B) issubclass() won't work on a list of classs,
>> > the way isinstance() does.
>>
>> That sounds more reasonable. I can't think of any
>> reason why it shouldn't work.
There is an issue
Crutcher Dunnavant wrote:
> While nocking together a framework today, I ran into the amazing
> limitations of issubclass().
>
> A) issubclass() throws a TypeError if the object being checked is not
> a class, which seems very strange. It is a predicate, and lacking a
> isclass() method, it should
On Apr 4, 2006, at 11:41 PM, Alex Martelli wrote:
> IMHO, the solution to THAT very real problem is to supply a built-in
> function that catches some exceptions and maps them into suitable
> return values. Simplest would be something like:
[...]
> though I'm sure we can get better syntax if we turn
On Apr 4, 2006, at 8:18 PM, Crutcher Dunnavant wrote:
...
>> There's no rule that predicate cannot raise an exception.
>
> No, but it makes many applications (such as using it as a test in list
> comprehensions) difficult enough to not be worth it.
IMHO, the solution to THAT very real problem
On 4/4/06, Guido van Rossum <[EMAIL PROTECTED]> wrote:
> On 4/4/06, Crutcher Dunnavant <[EMAIL PROTECTED]> wrote:
> > On 4/4/06, Greg Ewing <[EMAIL PROTECTED]> wrote:
> > > Crutcher Dunnavant wrote:
> > >
> > > > A) issubclass() throws a TypeError if the object being checked is not
> > > > a class,
On 4/4/06, Crutcher Dunnavant <[EMAIL PROTECTED]> wrote:
> On 4/4/06, Greg Ewing <[EMAIL PROTECTED]> wrote:
> > Crutcher Dunnavant wrote:
> >
> > > A) issubclass() throws a TypeError if the object being checked is not
> > > a class, which seems very strange.
> >
> > If I ever pass a non-class to is
On 4/4/06, Greg Ewing <[EMAIL PROTECTED]> wrote:
> Crutcher Dunnavant wrote:
>
> > A) issubclass() throws a TypeError if the object being checked is not
> > a class, which seems very strange.
>
> If I ever pass a non-class to issubclass() it's almost
> certainly a bug in my code, and I'd want to kn
Crutcher Dunnavant wrote:
> A) issubclass() throws a TypeError if the object being checked is not
> a class, which seems very strange.
If I ever pass a non-class to issubclass() it's almost
certainly a bug in my code, and I'd want to know about
it.
On the rare occasions when I don't want this, I
While nocking together a framework today, I ran into the amazing
limitations of issubclass().
A) issubclass() throws a TypeError if the object being checked is not
a class, which seems very strange. It is a predicate, and lacking a
isclass() method, it should just return False.
B) issubclass() won