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

Blanks as singleton #1081

Merged
merged 3 commits into from
Aug 31, 2024
Merged

Blanks as singleton #1081

merged 3 commits into from
Aug 31, 2024

Conversation

mmatera
Copy link
Contributor

@mmatera mmatera commented Aug 31, 2024

Looking at the initialization process, Blank* PatternObjets are created several times. This PR makes that these elements be created just once when a parameter is not provided. This would also help to optimize the pattern-matching algorithm when we face that problem.

# empty dict {}
instance.formats = {}
return instance

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is already done in Builtin.__new__(...)

@rocky
Copy link
Member

rocky commented Aug 31, 2024

LGTM

@mmatera mmatera marked this pull request as ready for review August 31, 2024 17:47
@mmatera mmatera merged commit 1bebd2c into master Aug 31, 2024
12 checks passed
@mmatera mmatera deleted the blanks_singleton branch August 31, 2024 19:06
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