Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: singhbgithub-compass/PyTricks
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: brennerm/PyTricks
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Nov 18, 2020

  1. Make this example more meaningful/fix bug (brennerm#108)

    By doing:
    
    ```
    @contextlib.contextmanager
    def unlock(resource):
        resource = 'unlocked'
        ...
    ```
    We don't really change  the `resource` that is passed in. Because Python is pass by object reference, doing a re-assignment operation does not actually change the `resource` i.e. `resource = 'unlocked'` does not really work. Furthermore, the `resource` variable, with which the `unlock` function is called, is a string; strings are immutable; thus, we need to pass in a mutable data type as the `resource` to be able to demonstrate the resource's "lock state" changing. While we could have used a simple "box" tactic i.e. `resource = ['locked']`, this seemed to distract from the goal of the example. Consequently, it seemed using a small class might be clearer without detracting from the example's value.
    bhelabhav authored Nov 18, 2020
    Configuration menu
    Copy the full SHA
    2c6571f View commit details
    Browse the repository at this point in the history

Commits on Dec 24, 2020

  1. docs: fix simple typo, recieves -> receives (brennerm#109)

    There is a small typo in metatable.py.
    
    Should read `receives` rather than `recieves`.
    timgates42 authored Dec 24, 2020
    Configuration menu
    Copy the full SHA
    cae22a0 View commit details
    Browse the repository at this point in the history
Loading