On further reflection I realized that access(schema) is for more than just a type key - it works for nested schemas and parsed type expressions, which we have no other way to discover than access(schema). Here I propose retrieve(schema) which is the alternative to access(schema), which does enforce the schema being present. We should use retrieve(schema) everywhere we want that behavior, and leave access to simply return None if nothing is found.
On further reflection I realized that
access(schema)
is for more than just a type key - it works for nested schemas and parsed type expressions, which we have no other way to discover thanaccess(schema)
. Here I proposeretrieve(schema)
which is the alternative toaccess(schema)
, which does enforce the schema being present. We should useretrieve(schema)
everywhere we want that behavior, and leave access to simply return None if nothing is found.