Skip to content

about scope #197

Description

@gordinmitya

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.

Activity

  1. gregmalcolm commented on Mar 5, 2021

    @gregmalcolm
    Owner

    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!

  2. ria-19 commented on Mar 5, 2021

    @ria-19

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions