Content-Length: 322210 | pFad | https://github.com/python/cpython/issues/104276

ED Use type flag instead of custom constructor in `_struct.unpack_iterator` · Issue #104276 · python/cpython · GitHub
Skip to content

Use type flag instead of custom constructor in _struct.unpack_iterator #104276

@chgnrdv

Description

@chgnrdv

Currently _struct.unpack_iterator type defines its own constructor just to report to user that it isn't instantiable (with a typo, by the way):

cpython/Modules/_struct.c

Lines 1835 to 1838 in 8d95012

PyObject *unpackiter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
PyErr_Format(PyExc_TypeError, "Cannot create '%.200s objects", _PyType_Name(type));
return NULL;
}

It can be easily removed and replaced by appropriate type flag. I'll submit a PR.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancement

    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/104276

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy