Skip to content

Comments

74: Fix typing of catch_and_convert_exceptions decorator so type of c…#87

Merged
lfse-slafleur merged 2 commits intomainfrom
74-add-more-useful-constructors-to-s2-classes
Mar 20, 2025
Merged

74: Fix typing of catch_and_convert_exceptions decorator so type of c…#87
lfse-slafleur merged 2 commits intomainfrom
74-add-more-useful-constructors-to-s2-classes

Conversation

@lfse-slafleur
Copy link
Member

…lasses is the actual class instead of S2MessageComponent.

…lasses is the actual class instead of S2MessageComponent.
@lfse-slafleur lfse-slafleur self-assigned this Mar 12, 2025
@lfse-slafleur lfse-slafleur linked an issue Mar 12, 2025 that may be closed by this pull request
@lfse-slafleur lfse-slafleur marked this pull request as ready for review March 12, 2025 14:46
@lfse-slafleur
Copy link
Member Author

@wcoenraads @MauriceHendrix Considering you are both active at the moment with code, I thought to ask you for this review.

Copy link
Contributor

@MauriceHendrix MauriceHendrix left a comment

Choose a reason for hiding this comment

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

Looks ok to me.
are you no longer using B_co (line 8)? If so perheps best to remove it

@lfse-slafleur
Copy link
Member Author

@MauriceHendrix Why did you close this PR?

@lfse-slafleur lfse-slafleur reopened this Mar 14, 2025
Copy link
Collaborator

@wcoenraads wcoenraads left a comment

Choose a reason for hiding this comment

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

Looks good to me! I have to admit I'm not 100% sure why this change would work better with IDEs, but I don't see any issues either so I'm fine to merge.

@Flix6x
Copy link
Collaborator

Flix6x commented Mar 18, 2025

I did notice that this fix of the typing issue will let PyCharm autocomplete on any fields or functions once the object is constructed.

I actually didn't notice a difference in PyCharm from this change. Autocomplete seemed to work already for fields or functions on the instantiated object (I reproduced the example in your image). Even before installing the Pydantic plugin the autocomplete was available.

from s2python.message import FRBCActuatorStatus

status = FRBCActuatorStatus()
status.  # this showed up the autocomplete dialogue

@lfse-slafleur lfse-slafleur merged commit 9a63aa2 into main Mar 20, 2025
38 checks passed
@lfse-slafleur lfse-slafleur deleted the 74-add-more-useful-constructors-to-s2-classes branch March 20, 2025 14: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.

Add more useful constructors to S2 classes

4 participants