On 4/8/07, Paul Pogonyshev <[EMAIL PROTECTED]> wrote:
> > assert hasattr(x, '__call__')
> >
> > I note that callable() was introduced before all callable objects had
> > a __call__ attribute. This is no longer the case, so it's not needed.
> I just didn't think about that possibility.  If that works the same way,
> callable() is just a sugar and not something unimplementable in other
> ways.  Therefore, my objection is discarded.  (But PEP 3100 should probably
> be update to mention this, otherwise you may get this complaint again ;)

I whole-heartedly agree here, because people who start learning python
(like me some time ago) usually learn that it's bad to test for
__call__ (can't remember where I read about that though), and that we
should always use callable() to be on a safe side. When I first heard
that callable() was going to be removed I kinda panicked myself, it's
good to know that at least there's still a way to be sure that object
is callable or not...
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to