Message286367
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:22 | vstinner | set | recipients:
+ vstinner, larry, methane, serhiy.storchaka |
2017-01-27 15:22:21 | vstinner | set | messageid: <1485530541.92.0.911652248603.issue29300@psf.upfronthosting.co.za> |
2017-01-27 15:22:21 | vstinner | link | issue29300 messages |
2017-01-27 15:22:21 | vstinner | create | |
|