Skip to content

Fix class property lookup for inverse restrictions#57

Open
vibhor-aggr wants to merge 1 commit into
pwin:masterfrom
vibhor-aggr:codex/fix-inverse-class-properties
Open

Fix class property lookup for inverse restrictions#57
vibhor-aggr wants to merge 1 commit into
pwin:masterfrom
vibhor-aggr:codex/fix-inverse-class-properties

Conversation

@vibhor-aggr

Copy link
Copy Markdown

Fixes #32.

ThingClass.get_class_properties() and ThingClass.INDIRECT_get_class_properties() assumed every restriction property exposes _class_property_some and _class_property_only. Inverse property constructs do not expose those flags, so classes with inverse restrictions raised AttributeError when their class properties were inspected.

This change uses defensive class-property flag lookup for restriction properties and adds a regression test covering direct and inherited inverse restrictions.

Validation:

uv run --with-editable . python -m unittest test.regtest.Test.test_inverse_1 test.regtest.Test.test_inverse_2 test.regtest.Test.test_inverse_2_get_class_properties test.regtest.Test.test_inverse_3 test.regtest.Test.test_class_prop_12 test.regtest.Test.test_class_prop_13 test.regtest.Test.test_class_prop_14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crashing trying to get INDIRECT_get_classes_properties() of entities with Inverse relations

1 participant