[issue43917] An error in classmethod example in the documentation of descriptor

2021-04-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: Okay, it's fixed. Thanks for the report. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior versions: +Python 3.10 ___ Python tracker

[issue43917] An error in classmethod example in the documentation of descriptor

2021-04-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 34be48450f03b121be10a9f8e8989603478f0469 by Miss Islington (bot) in branch '3.9': bpo-43917: Fix pure python equivalent for classmethod (GH-25544) (GH-25546) https://github.com/python/cpython/commit/34be48450f03b121be10a9f8e8989603478f0469

[issue43917] An error in classmethod example in the documentation of descriptor

2021-04-22 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24270 pull_request: https://github.com/python/cpython/pull/25546 ___ Python tracker _

[issue43917] An error in classmethod example in the documentation of descriptor

2021-04-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 14092b5a4ae4caf1c77f685450016a0d1ad0bd6c by Raymond Hettinger in branch 'master': bpo-43917: Fix pure python equivalent for classmethod (GH-25544) https://github.com/python/cpython/commit/14092b5a4ae4caf1c77f685450016a0d1ad0bd6c --

[issue43917] An error in classmethod example in the documentation of descriptor

2021-04-22 Thread Raymond Hettinger
Change by Raymond Hettinger : -- pull_requests: +24268 pull_request: https://github.com/python/cpython/pull/25544 ___ Python tracker ___ ___

[issue43917] An error in classmethod example in the documentation of descriptor

2021-04-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: It looks like it should be: if hasattr(type(self.f), "__get__"): Here's the relevant C code: static PyObject * cm_descr_get(PyObject *self, PyObject *obj, PyObject *type) { classmethod *cm = (classmethod *)self; if (cm->cm_callable == NULL)

[issue43917] An error in classmethod example in the documentation of descriptor

2021-04-22 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch nosy: +python-dev nosy_count: 3.0 -> 4.0 pull_requests: +24262 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25541 ___ Python tracker _

[issue43917] An error in classmethod example in the documentation of descriptor

2021-04-22 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: docs@python -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue43917] An error in classmethod example in the documentation of descriptor

2021-04-22 Thread Egor
New submission from Egor : In this section https://docs.python.org/3/howto/descriptor.html#class-methods in the example of python implementation of ClassMethod inside __get__ method I think that we should check hasattr(self.f, "__get__") instead of hasattr(obj, "__get__"). -- assigne