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

tlz (toolz switching lib) doesn't import compatibility by default #349

Merged
merged 1 commit into from Oct 20, 2020

Conversation

jamiecook
Copy link
Contributor

@jamiecook jamiecook commented Sep 28, 2020

This results in the following error

>>> import tlz
>>> tlz.compatibility.zip([1,2], [3,4])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'toolz' has no attribute 'compatibility'
>>> tlz.valfilter
<function valfilter at 0x10bd30a70>

This could be solved by importing tlz.compability

>>> import tlz.compatibility
>>> print(list(tlz.compatibility.zip([1,2], [3,4])))
[(1, 3), (2, 4)]

but zip is part of the standard and the compatibility layer is being deprecated anyway, so lets just use the python core version

20200928 15:26:04 ! jamie@jamie-work-mbp:~/git
λ PYENV_VERSION=3.7.2 python -c "print(list(zip([1,2], [3,4])))"
[(1, 3), (2, 4)]
20200928 15:26:11 ! jamie@jamie-work-mbp:~/git
λ PYENV_VERSION=2.7 python -c "print(list(zip([1,2], [3,4])))"
[(1, 3), (2, 4)]

closes #350

@jamiecook jamiecook changed the title new versions of toolz dont seem to have a compatibility component tlz (toolz switching lib) doesn't import compatibility by default Sep 28, 2020
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.002%) to 81.091% when pulling c795eef on jamiecook:jamiecook/py_fixes into bd55f26 on ActivitySim:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.002%) to 81.091% when pulling c795eef on jamiecook:jamiecook/py_fixes into bd55f26 on ActivitySim:master.

@bstabler
Copy link
Contributor

See also #350

@bstabler
Copy link
Contributor

bstabler commented Oct 8, 2020

@toliwaga to resolve this and #350

@bstabler bstabler assigned bstabler and unassigned toliwaga Oct 20, 2020
@bstabler bstabler merged commit 975d2b2 into ActivitySim:master Oct 20, 2020
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.

Compatibility Issues with Toolz (v11)
4 participants