I'd make exclude and only private API because they are used in _normalize_nested_options which is called only at __init__.
I'd also make load_only and dump_only private because setting them after __init__ conflicts with
self.load_only = set(load_only) or set(self.opts.load_only)
self.dump_only = set(dump_only) or set(self.opts.dump_only)
Likewise with unknown and context due to
self.unknown = unknown or self.opts.unknown
self.context = context or {}
(setting them to None after __init__ wouldn't be the same as in __init__)
At this point, I'm tempted to make everything private. I mean the attributes above plus many, ordered and partial.
Adding the underscore would break libs using marshmallow (like apispec) but that's life. Or is there another way to signify those are private? Like, just a comment in the docstring?
Originally posted by @lafrech in #1258 (comment)
I'd make
excludeandonlyprivate API because they are used in_normalize_nested_optionswhich is called only at__init__.I'd also make
load_onlyanddump_onlyprivate because setting them after__init__conflicts withLikewise with
unknownandcontextdue to(setting them to
Noneafter__init__wouldn't be the same as in__init__)At this point, I'm tempted to make everything private. I mean the attributes above plus
many,orderedandpartial.Adding the underscore would break libs using marshmallow (like apispec) but that's life. Or is there another way to signify those are private? Like, just a comment in the docstring?
Originally posted by @lafrech in #1258 (comment)