This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients larry, methane, serhiy.storchaka, vstinner
Date 2017-01-27.15:22:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
New patch version 5 without the "format_converter".

Serhiy Storchaka: I said not about the converter that converts format to bytes (it is needed only in Struct.__init__),

For me, it makes sense to check format type earlier than Struct.__init__(), but since you like the current code, I'm also ok to leave this part of the code unchanged :-)

Serhiy: but about the converter that converts format to the Struct object. It is used in all module-level functions.

Sorry, but I dislike this change. Even if multiple functions do the same, for me creating a Struct object is not something part of the argument parsing. I prefer to keep the following 3 lines in each C function *body* to ease debugging:

    PyObject *s_object = cache_struct(format);
    if (s_object == NULL)
        return NULL;

IMHO my struct_fastcall-5.patch is already big enough. I prefer incremental changes.

I have no strong opinion on cache_struct(), just a matter of taste :-) And others may like your change!

Feel free to write your own patch on top of mine, once mine is merged ;-)
Date User Action Args
2017-01-27 15:22:22vstinnersetrecipients: + vstinner, larry, methane, serhiy.storchaka
2017-01-27 15:22:21vstinnersetmessageid: <>
2017-01-27 15:22:21vstinnerlinkissue29300 messages
2017-01-27 15:22:21vstinnercreate