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-June/025890.html below:

Type Names in the types Module

[Python-Dev] PEP 294: Type Names in the types ModuleMichael Hudson mwh@python.net
25 Jun 2002 00:09:38 +0100
Oren Tirosh <oren-py-l@hishome.net> writes:

> Abstract
> 
>     This PEP proposes that symbols matching the type name should be
>     added to the types module for all basic Python types in the types
>     module:
> 
>         types.IntegerType -> types.int
>         types.FunctionType -> types.function
>         types.TracebackType -> types.traceback
>          ...    
> 
>     The long capitalized names currently in the types module will be
>     deprecated.

Um, can I be a little confused?  If you are writing code that you know
will be run in 2.2 and later, you write

   isinstance(obj, int)

If you want to support 2.1 and so on, you write 

   isinstance(obj, types.IntType)

What would writing 

   isinstance(obj, types.int)

ever gain you except restricting execution to 2.3+?

I mean, I don't have any real opinion *against* this pep, I just don't
really see why anyone would care...

Cheers,
M.

-- 
  it's not that perl programmers are idiots, it's that the language
  rewards idiotic behavior in a  way that no other language or tool
  has ever done                         -- Erik Naggum, comp.lang.lisp




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