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

Change memory compare #52

Closed
wants to merge 1 commit into from
Closed

Conversation

tmiklu
Copy link

@tmiklu tmiklu commented Jan 16, 2021

Hi @mikeckennedy
A variables christmas and todaydate will never meet condition because they always have a different id in memory location.
You can use sys.intern() to intern strings for performance. This function allows you to compare their memory addresses rather than comparing the strings character-by-character

@mikeckennedy
Copy link
Member

Thanks so much for pointing out this mistake. You're totally right, but Julian should have just used != or == for the test. I updated the code to work correctly.

@tmiklu tmiklu deleted the fix-christmas branch January 17, 2021 15:17
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