[issue29251] Class __dict__ is only a mapping proxy

2017-03-30 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

I believe the docs defined that, usually using a bold "CPython implementation 
detail" sentence.

It seems like it's something that would be considered an implementation detail, 
though, according to Raymond's answer here: 
http://stackoverflow.com/questions/32720492/why-is-a-class-dict-a-mappingproxy

Changing it to just state it's a mapping definitely looks like the safest 
option.

--

___
Python tracker 

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



[issue29251] Class __dict__ is only a mapping proxy

2017-03-27 Thread Martin Panter

Martin Panter added the comment:

I don’t know if it is an implementation detail or not. Maybe it is the 
documentation itself which defines that. Anyway, I think your wording would 
have been fine for my original problem.

I wonder if we should clarify that only reading the mapping is supported, even 
if we don’t define any particular behaviour for modifying it (like updating the 
namespace, raising an exception, ignoring the change, etc).

--

___
Python tracker 

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



[issue29251] Class __dict__ is only a mapping proxy

2017-03-27 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

Isn't the fact that it's read-only a CPython implementation detail? That is, 
shouldn't that just read: 

"gives a :term:`mapping` object representing the class's namespace"

so as to not enforce anything on any other implementations?

--
nosy: +Jim Fasarakis-Hilliard

___
Python tracker 

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



[issue29251] Class __dict__ is only a mapping proxy

2017-01-12 Thread Martin Panter

New submission from Martin Panter:

The __dict__ attribute of class objects is documented as being a (standard) 
dictionary, but implemented with a proxy object. I propose to clarify the 
documentation in “Custom classes” under 
,
 and in .

I believe my changes are also applicable to Python 2, as long as I point out 
the proxy is specific to “new-style” classes.

--
assignee: docs@python
components: Documentation
files: class-dict.patch
keywords: patch
messages: 285313
nosy: docs@python, martin.panter
priority: normal
severity: normal
stage: patch review
status: open
title: Class __dict__ is only a mapping proxy
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46268/class-dict.patch

___
Python tracker 

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