Content-Length: 301632 | pFad | https://github.com/python/cpython/issues/140487

88 `Py_RETURN_NOTIMPLEMENTED` should INCREF on stable API 3.11 · Issue #140487 · python/cpython · GitHub
Skip to content

Py_RETURN_NOTIMPLEMENTED should INCREF on stable API 3.11 #140487

@hpkfft

Description

@hpkfft

Bug report

Bug description:

In object.h, I believe

#define Py_RETURN_NOTIMPLEMENTED return Py_NOTIMPLEMENTED

should be

#if defined(Py_LIMITED_API) && Py_LIMITED_API+0 < 0x030c0000
#  define Py_RETURN_NOTIMPLEMENTED return Py_NewRef(Py_NOTIMPLEMENTED)
#else
#  define Py_RETURN_NOTIMPLEMENTED return Py_NOTIMPLEMENTED

and Py_NotImplemented should add Changed in version 3.12: Py_NOTIMPLEMENTED is immortal.

and Py_RETURN_NOTIMPLEMENTED should say Return Py_NotImplemented from a function. without saying it creates a new strong reference.

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/140487

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy