isaacg1 / pyth

Pyth, an extremely concise language. Try it here:
https://pyth.herokuapp.com/
MIT License
263 stars 57 forks source link

Fix issue 181 #183

Closed muddyfish closed 8 years ago

muddyfish commented 8 years ago

Extends }, Pin so it functions for cases where A > B

jakobkogler commented 8 years ago

Hi Simon. Can you add one or two test cases to test.py? This way we can automatically see if the implementation works.

On Sat, Mar 5, 2016, 3:22 PM Simon Beal notifications@github.com wrote:

Extends }, Pin so it functions for cases where A > B

You can view, comment on, or merge this pull request online at:

https://github.com/isaacg1/pyth/pull/183 Commit Summary

  • Fix issue 181

File Changes

Patch Links:

— Reply to this email directly or view it on GitHub https://github.com/isaacg1/pyth/pull/183.

muddyfish commented 8 years ago

I've just added some test cases (just so you know, test.py doesn't work under python3.5)

jakobkogler commented 8 years ago

@muddyfish Are you sure? What is exactly the problem? I'm running Python 3.5.1 and it works fine for me.

muddyfish commented 8 years ago

I'm on python 3.5.0, failing with TypeError: Required argument 'user_function' (pos 1) not found in

Traceback (most recent call last):
  File "test.py", line 860, in <module>
    test(*test_case)
  File "test.py", line 839, in test
    output, error = pyth.run_code(pyth_code, input_message)
  File "d:\Python\pyth\pyth\pyth.py", line 568, in run_code
    saved_env = c.deepcopy(environment)
  File "c:\ProgramData\chocolatey\lib\python3\tools\lib\copy.py", line 155, in deepcopy
    y = copier(x, memo)
  File "c:\ProgramData\chocolatey\lib\python3\tools\lib\copy.py", line 244, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "c:\ProgramData\chocolatey\lib\python3\tools\lib\copy.py", line 182, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "c:\ProgramData\chocolatey\lib\python3\tools\lib\copy.py", line 293, in _reconstruct
    y = callable(*args)
  File "c:\ProgramData\chocolatey\lib\python3\tools\lib\copyreg.py", line 88, in __newobj__
    return cls.__new__(cls, *args)
TypeError: Required argument 'user_function' (pos 1) not found

I believe this is because lru_cache fails to deepcopy properly in my version. (I installed 3.3 and it worked fine)