python 3000 and removal of builtin callable

M

Mirko Zeibig

Hello everybody,

I recently stumbled across the proposal of removing `callable` in Python
3000 (http://python.org/peps/pep-3000.html) catching an exception
instead, maybe something like this:
--- snip ---
[mize@lxmize mize]$ python2.3
Python 2.3.3 (#1, Apr 6 2004, 01:47:39)
[GCC 3.3.3 (SuSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.Traceback (most recent call last):
--- snap ---

This is not an option for e.g. IDEs as some functions might actually do
something when called ;-) and I like `callable` for introspection.

Other ways would be to check for the `__call__` attribute or use several
methods of the `inspect`-Module, both of which are not better than
`callable` IMHO.

Regards
Mirko
 
N

Nicolas Fleury

Mirko said:
This is not an option for e.g. IDEs as some functions might actually do
something when called ;-) and I like `callable` for introspection.

Other ways would be to check for the `__call__` attribute or use several
methods of the `inspect`-Module, both of which are not better than
`callable` IMHO.

I totally agree with you. The callable function could be moved to a
module and be built-in, but it cannot really be removed. Calling a
callable and know if an object is a callable without calling it is
definitely not the same thing.

Regards,
Nicolas
 
N

Nick Coghlan

Nicolas said:
I totally agree with you. The callable function could be moved to a
module and be built-in, but it cannot really be removed. Calling a
callable and know if an object is a callable without calling it is
definitely not the same thing.

For many of the builtins to be "removed" in Py3k, I believe the actual intent is
to move them to a module (e.g. sys), with the removal being "remove from the
builtins", not "remove from Python".

Cheers,
Nick.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top