diff options
author | Campbell Barton <campbell@blender.org> | 2022-04-08 02:41:28 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-04-08 04:49:50 +0300 |
commit | 982aea88e0d74020c62c2054a45eeafa56c8ca30 (patch) | |
tree | 6215fe088028a0943ace5ea80e256b7a42132420 /source/blender/python/intern/bpy_rna.c | |
parent | 87a3bf33564b035e4c2400098ea4932d5dfdba5d (diff) |
Cleanup: separate format-units for Python argument parsing
With the increased use of multi-character format units and keyword-only
arguments these are increasingly difficult to make sense of.
Split the string onto multiple lines, one per argument.
While verbose it's easier to understand and add new arguments.
Diffstat (limited to 'source/blender/python/intern/bpy_rna.c')
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index a28137c3bed..5db66405403 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -3462,7 +3462,14 @@ static PyObject *pyrna_struct_is_property_set(BPy_StructRNA *self, PyObject *arg PYRNA_STRUCT_CHECK_OBJ(self); static const char *_keywords[] = {"", "ghost", NULL}; - static _PyArg_Parser _parser = {"s|$O&:is_property_set", _keywords, 0}; + static _PyArg_Parser _parser = { + "s" /* `name` (positional). */ + "|$" /* Optional keyword only arguments. */ + "O&" /* `ghost` */ + ":is_property_set", + _keywords, + 0, + }; if (!_PyArg_ParseTupleAndKeywordsFast(args, kw, &_parser, &name, PyC_ParseBool, &use_ghost)) { return NULL; } |