Skip to content

MATCH operator accepts non-INT option values. #172

@python-processing-unit

Description

@python-processing-unit

According to the specification section 9.1.7:

  • BOOL: MATCH(MAP: map, MAP: template, INT: typing = 0, INT: recurse = 0, INT: shape = 0) = MUST return TRUE if every key in template is present in map. When typing is non-zero, the corresponding stored value types MUST also match. When shape is non-zero, corresponding tensor values MUST additionally have identical shapes. When recurse is non-zero, the same rules MUST be applied recursively to nested maps. Any failed condition MUST produce FALSE rather than raising an error.

In the implementation, however, MATCH accepts non-INT values for its optional INT parameters instead of raising a runtime type error. As a result, calls that pass a STR (or other non-INT) for typing, recurse, or shape can succeed when they should fail with a type error.

Metadata

Metadata

Labels

bugSomething isn't workinginterpreterRequires a code change in the interpreter.patchRequires a patch version change.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions