Skip to content

Fix-up of PR #8393: Fix broken support for container AutoPropertyObject#11835

Merged
feerrenrut merged 1 commit into
nvaccess:masterfrom
accessolutions:pr8393-getter
Nov 18, 2020
Merged

Fix-up of PR #8393: Fix broken support for container AutoPropertyObject#11835
feerrenrut merged 1 commit into
nvaccess:masterfrom
accessolutions:pr8393-getter

Conversation

@JulienCochuyt

Copy link
Copy Markdown
Contributor

Link to issue number:

Fix-up of PR #8393

Summary of the issue:

As of PR #8393, baseObjects.Getter and CachingGetter now include in their __get__ method a boolean-coercion test on the AutoPropertyObject instance.
This test, namely if not instance, fails in its purpose if ever the AutoPropertyObject defines either a __len__ or a __bool__ method.

Long story short, it has been the cause of a regression in WebAccess, where we historically used the AutoPropertyObject facility on objects that are also containers.

Description of how this pull request fixes the issue:

Change the boolean-coercion test into a test for nullity: if instance is None.

Testing performed:

Known issues with pull request:

Change log entry:

I don't think this deserves a change log entry.

@feerrenrut feerrenrut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me.

@feerrenrut

Copy link
Copy Markdown
Contributor

I won't merge this until tomorrow, to allow others to review it if they wish.

@feerrenrut feerrenrut merged commit 1ffb6bd into nvaccess:master Nov 18, 2020
@nvaccessAuto nvaccessAuto added this to the 2020.4 milestone Nov 18, 2020
@JulienCochuyt JulienCochuyt deleted the pr8393-getter branch November 18, 2020 06:28
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.

3 participants