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

about scope #197

Open
gordinmitya opened this issue Jul 29, 2019 · 2 comments
Open

about scope #197

gordinmitya opened this issue Jul 29, 2019 · 2 comments

Comments

@gordinmitya
Copy link

Hey, looks like typo in about_scope.py:73

 def test_incrementing_with_local_counter(self):
        global counter
        start = counter
        self.increment_using_local_counter(start)  # should be `counter` instead of `start`
        self.assertEqual(False, counter == start + 1)

Yes, in both cases the answer is False. But logically in start we should keep initial value and then compare with modified counter.

@gregmalcolm
Copy link
Owner

gregmalcolm commented Mar 5, 2021

Well... I'm going to make admission. I wrote this a long time ago. I have hardly any recollection of writing this koan at all. But... looking back at it with fresh eyes this compared with the next koantest_incrementing_with_global_counter is super confusing. I can see my intent was to show the difference in scope but this doesn't prove it at all well, because the tests for local vs global counters are almost identical!

So I'll throw down the gauntlet. If someone wants to make a cool contribution to Python Koans, this is a great place to start!

@ria-19
Copy link

ria-19 commented Mar 5, 2021

I would like to work on this issue.

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

No branches or pull requests

3 participants