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

fix: memorize unique id #534

Merged
merged 2 commits into from
Mar 14, 2023
Merged

fix: memorize unique id #534

merged 2 commits into from
Mar 14, 2023

Conversation

bdraco
Copy link
Contributor

@bdraco bdraco commented Mar 13, 2023

slugify is a relatively expensive operation because it has to do unicode work.

Ideally we could use self._attr_unique_id in __init__ but self.type is set after the parent's __init__ is called.

@bdraco bdraco changed the title Memorize unique id fix: memorize unique id Mar 13, 2023
@bdraco bdraco marked this pull request as ready for review March 13, 2023 23:22
@alandtse
Copy link
Owner

Thanks. And just FYI, the technical term is memoize, not memorize. ;)

@alandtse alandtse merged commit 05f1689 into alandtse:dev Mar 14, 2023
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.

2 participants