Skip to content

Conversation

@dmamelin
Copy link
Contributor

Improved class loading: added support for dataclass, enum, metaclass, and keywords, and now ignoring inaccessible attributes during class creation (seen when instantiating homeassistant.helpers.entity.Entity due to ABCCachedProperties attribute caching).
Fixes #142, #537, #603.

@ALERTua
Copy link
Contributor

ALERTua commented Nov 27, 2025

it would be nice for the PR to contain only one major change for the diff readability :)
are you sure the tests cover every new supported concept?
will try this PR on my production.

@ALERTua
Copy link
Contributor

ALERTua commented Nov 27, 2025

I have found no problems while using this PR. I didn't yet try the new supported concepts though.

@dmamelin
Copy link
Contributor Author

@ALERTua
Yes, the tests don’t cover all new features. The primary goal was to improve native class loading, especially for dataclass and enum - and that part is covered by tests.

@ALERTua
Copy link
Contributor

ALERTua commented Nov 27, 2025

if you would be so kind to also expand the documentation <3

@dmamelin
Copy link
Contributor Author

if you would be so kind to also expand the documentation <3

Which part exactly?
I think the language-limitations section already describes the capabilities and restrictions fairly well.
"The language coverage is relatively complete" - we just need to move closer to complete.
There isn’t a separate section listing all supported features.

@craigbarratt craigbarratt merged commit e71c012 into custom-components:master Nov 27, 2025
6 checks passed
@craigbarratt
Copy link
Member

Thanks! Classes in pyscript are definitely a weak area in terms of completeness and correctness, so these improvements are much appreciated. Thanks for adding some tests.

@dmamelin dmamelin deleted the feature/improve-class-loading branch November 27, 2025 18:32
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.

Problem with enum classes

3 participants