[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2019-11-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16689
pull_request: https://github.com/python/cpython/pull/17180

___
Python tracker 

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



[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2019-10-08 Thread hongweipeng


Change by hongweipeng :


--
pull_requests: +16228
pull_request: https://github.com/python/cpython/pull/16645

___
Python tracker 

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



[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2019-03-20 Thread Aaron Hall


Change by Aaron Hall :


--
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2019-03-19 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

It looks like this issue can be closed now that it's merged?

--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2018-05-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 4054b172ab59054715a2aaf4979bd84ac23e3ada by Serhiy Storchaka 
(Aaron Hall, MBA) in branch 'master':
bpo-26103: Fix inspect.isdatadescriptor() and a data descriptor definition. 
(GH-1959)
https://github.com/python/cpython/commit/4054b172ab59054715a2aaf4979bd84ac23e3ada


--

___
Python tracker 

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



[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2018-05-14 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
versions: +Python 3.8 -Python 3.5

___
Python tracker 

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



[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2017-12-11 Thread Lior Cohen

Lior Cohen  added the comment:

Joining @Serhiy Storchaka last question.
Is the __get__ method existance is a must be a data descriptor?

According to the C implementation in descrobject.h
```
#define PyDescr_IsData(d) (Py_TYPE(d)->tp_descr_set != NULL)
#endif
```
the answer is No.
Does this C code reflect the true definition?

--
nosy: +chnlior

___
Python tracker 

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



[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2017-09-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The only question is remained -- should *data descriptors* be *descriptors*? 
I.e. is the __get__ method required for data descriptors?

--

___
Python tracker 

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



[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2017-09-11 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: rhettinger -> 

___
Python tracker 

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



[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2017-09-04 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2017-09-03 Thread Aaron Hall

Aaron Hall added the comment:

Serhiy,

Not sure what else needs to be done to wrap this up. All checks are passing on 
the pull request.

Thoughts?

--

___
Python tracker 

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



[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2017-06-07 Thread Aaron Hall

Aaron Hall added the comment:

I tweaked the docs a little more this morning, but I believe I am done making 
any further changes unless so requested.

This issue doesn't say it's assigned to anyone. Is there anything else that 
needs to happen here?

--

___
Python tracker 

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



[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2017-06-06 Thread Aaron Hall

Aaron Hall added the comment:

> Please also add yourself to Misc/ACKS.

Done!

--

___
Python tracker 

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



[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2017-06-06 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Please also add yourself to Misc/ACKS.

--
nosy: +Mariatta

___
Python tracker 

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



[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2017-06-06 Thread Aaron Hall

Aaron Hall added the comment:

Added news, working on tests

--

___
Python tracker 

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



[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2017-06-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This isn't just a documentation issue since it fixes 
inspect.isdatadescriptor(). I confirm that the new implementation better 
matches the C code. LGTM, but needed tests for inspect.isdatadescriptor() and a 
Misc/NEWS entry.

--
assignee: docs@python -> 
nosy: +serhiy.storchaka
stage: needs patch -> patch review
versions: +Python 2.7, Python 3.7

___
Python tracker 

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



[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2017-06-05 Thread Aaron Hall

Changes by Aaron Hall :


--
pull_requests: +2030

___
Python tracker 

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



[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2017-06-05 Thread Aaron Hall

Aaron Hall added the comment:

Bumping this - I intend to work on this next, if no objections.

--

___
Python tracker 

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



[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2016-01-14 Thread SilentGhost

Changes by SilentGhost :


--
assignee:  -> docs@python
components: +Documentation, Library (Lib)
nosy: +docs@python, yselivanov
stage:  -> needs patch
versions:  -Python 2.7, 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



[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2016-01-13 Thread Aaron Hall

New submission from Aaron Hall:

Based on the data-model documentation 
(https://docs.python.org/2/reference/datamodel.html#invoking-descriptors) and 
the dotted lookup behavior, the follow definitions are correct:

"If the descriptor defines __set__() and/or __delete__(), it is a data 
descriptor; if it defines neither, it is a non-data descriptor."

def has_data_descriptor_attrs(obj):
return set(['__set__', '__delete__']) & set(dir(obj))

def is_data_descriptor(obj):
return bool(has_data_descriptor_attrs(obj))


However, the inspect module has the following, which is also reflected in the 
descriptor how-to 
(https://docs.python.org/2/howto/descriptor.html#descriptor-protocol):

"If an object defines both __get__() and __set__(), it is considered a data 
descriptor."

def isdatadescriptor(object):
"""Return true if the object is a data descriptor.

Data descriptors have both a __get__ and a __set__ attribute..."""
if isclass(object) or ismethod(object) or isfunction(object):
# mutual exclusion
return False
tp = type(object)
return hasattr(tp, "__set__") and hasattr(tp, "__get__")


I'm willing to sign a contributor release and fix myself.

--
messages: 258168
nosy: Aaron Hall
priority: normal
severity: normal
status: open
title: Contradiction in definition of "data descriptor" between (dotted lookup 
behavior/datamodel documentation) and (inspect lib/descriptor how-to)
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, 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