Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decorator to make properties symmetric #80

Closed
bckohan opened this issue Mar 7, 2025 · 0 comments
Closed

Decorator to make properties symmetric #80

bckohan opened this issue Mar 7, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@bckohan
Copy link
Owner

bckohan commented Mar 7, 2025

e.g. instead of:

    _symmetric_builtins_ = ['uri']

    @property
    def uri(self) -> str:
        return f'mapbox://styles/mapbox/{self.value}-v{self.version}'

just:

    @symmetric
    @property
    def uri(self) -> str:
        return f'mapbox://styles/mapbox/{self.value}-v{self.version}'
@bckohan bckohan self-assigned this Mar 7, 2025
@bckohan bckohan added the enhancement New feature or request label Mar 7, 2025
@bckohan bckohan closed this as completed in 4691793 Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant