and dicts, and add better raised exception types if versioning
couldn't be done. I changed workbench monkeypatching a bit, to
copy some class attributes over to the workbench wrapper
class-like callables, since some code expected those attributes
to be there (e.g. the versioning code).
class in the registry when you have an instance of one of those
classes. Because in that case, you can just get the class of the
instance and not deal with the registry at all.
functions. Changed some ">= 2.1" stix version semantics to be
"== 2.1", because we don't have any version >= 2.1, so they are
currently equivalent, and the is_*() functions don't support
STIX version ranges. They only support exact versions. We can
look at this again if a newer STIX version ever emerges.
Also added a class_for_type() function to the registry module,
which was useful for the versioning module changes described
above. I thought that function would be helpful in the parsing
module, to simplify code there, so I changed that module a bit
to use it.
dict/mapping values: do a simple verification of the value's
STIX version, not just its type. Added a lot more unit tests to
test behavior on dicts. To make the implementation work, I had
to move the detect_spec_version() function out of the parsing
module and into utils. So that required small changes at all
its previous call sites.
class map structure is keyed by normal "X.Y" style versions,
the convenience that function provided is no longer necessary.
So it no longer makes sense to have the function (at least,
not for that reason). Change users of that function to use
the STIX2_OBJ_MAPS structure directly.
level with STIX versions in the same format as is used everywhere
else in the API: "X.Y", as opposed to the "vXY" format used by
the version-specific python packages. This eliminates all of
the awkward conversion from public API format to "vXX" format.
Also a little bit of code rearranging in the registration module
to ensure that some STIX 2.1-specific checks are done whether
version 2.1 is given explicitly or is defaulted to.
In the same module I also added a missing import of
stix2.properties, since my IDE was claiming it could not find a
function from that module.