473,658 Members | 2,623 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

python 3000 and removal of builtin callable

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.
i = 5
i() Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: 'int' object is not callable

--- 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
--
Insert a sig please.
Jul 18 '05 #1
2 1504
Mirko Zeibig wrote:
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
Jul 18 '05 #2
Nicolas Fleury wrote:
Mirko Zeibig wrote:
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.


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.

--
Nick Coghlan | nc******@email. com | Brisbane, Australia
---------------------------------------------------------------
http://boredomandlaziness.skystorm.net
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3654
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc. And i have things to offer, and to request. And a lot of ideas, but who needs them.... here's an example (from type_struct.py):
0
8427
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8850
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8523
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8626
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6178
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.