[issue27544] Document the ABCs for instance/subclass checks of dict view types

2021-10-21 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.11 -Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27544] Document the ABCs for instance/subclass checks of dict view types

2016-07-17 Thread Emanuel Barry

Changes by Emanuel Barry :


--
title: documentiona of dict view types -> Document the ABCs for 
instance/subclass checks of dict view types

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27544] Document the ABCs for instance/subclass checks of dict view types

2016-07-22 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The view objects *are* built-ins, but are not exposed in the __builtins__ 
module.  This is true of many internal types, perhaps even a majority. The 
function and list_iterator classes are other examples.

>>> type(lambda: 0)

>>> type(iter([]))


A few such 'hidden' classes are exposed in the types module.

"This module provides names for many of the types that are required to 
implement a Python interpreter. It deliberately avoids including some of the 
types that arise only incidentally during processing such as the listiterator 
type.

Typical use of these names is for isinstance() or issubclass() checks."

The function class is.

"types.FunctionType
types.LambdaType

The type of user-defined functions and functions created by lambda 
expressions."
  
The list_iterator class is not. Perhaps the rationale is that there is no 
reason to know whether an iterator is iterating over a list, tuple, range, set, 
frozenset, dict, or anything else.  They are all used the same.  On the other 
hand, Different view types are used a bit differently.

Types includes a generic MappingProxyType.  Perhaps you should propose adding 
the specific dict view types.  Or you can create them yourself.
  KeysViewType = type({}.keys())
  ValuesViewType = type({}.values())
  ItemsViewType = type({}.items())
This is the code that would be used in the module if they were added there.

--
nosy: +terry.reedy
versions:  -Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27544] Document the ABCs for instance/subclass checks of dict view types

2018-04-14 Thread Jeffrey McLarty

Change by Jeffrey McLarty :


--
nosy: +Jeffrey McLarty

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com