A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-July/026359.html below:

Type Names in the types Module

[Python-Dev] PEP 294: Type Names in the types Module [Python-Dev] PEP 294: Type Names in the types ModuleOren Tirosh oren-py-d@hishome.net
Fri, 12 Jul 2002 19:41:51 +0300
On Fri, Jul 12, 2002 at 12:06:25PM -0400, Jeremy Hylton wrote:
> I recently wrote some code that needed to look for functions.  I wrote
> it this way:
> 
> from new import function
> 
> # ...
> 
> if isinstance(obj, function):
>     # ...
> 
> It didn't look odd at all.  And I don't care much where I import
> function from.  I wouldn't mind if all the type objects defined in new
> where available in types.  IOW, the names exported by new could also
> be exported by types.

That's exactly what PEP 294 proposed. The primary objection was that the 
documentation for the types module says that names exported by future 
versions will all end in "Type".  People that do 'from types import *' based
on this promise will tend to get offended if a variable called 'code' is 
clobbered.  Anyway, my mother also told me that breaking promises is not a 
nice thing to do so I try to keep that in mind when I design programming 
interfaces.

	Oren





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4