New submission from Géry <gery.o...@gmail.com>:

The [language 
documentation](https://docs.python.org/3/reference/datamodel.html#invoking-descriptors)
 states:

> Data descriptors with __set__() and __get__() defined always override a 
> redefinition in an instance dictionary. In contrast, non-data descriptors can 
> be overridden by instances.

This override is not limited to data descriptors defining `__set__()` (and 
`__get__()`). It is also true for data descriptors defining `__delete__()` (and 
`__get__()`) and data descriptors defining both `__set__()` and `__delete__()` 
(and `__get__()`).

In other words, _any_ data descriptors (objects defining either `__set__()` or 
`__delete__()` or both) defining `__get__()` override an attribute redefinition 
in an instance dictionary.

----------
assignee: docs@python
components: Documentation
messages: 353685
nosy: docs@python, maggyero
priority: normal
severity: normal
status: open
title: Remove the __set__ method restriction on data descriptors for attribute 
lookup precedence
type: enhancement
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38336>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to