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

why does the following crash jupyternotebook kernel? #6

Open
kundeng opened this issue Feb 17, 2020 · 2 comments
Open

why does the following crash jupyternotebook kernel? #6

kundeng opened this issue Feb 17, 2020 · 2 comments
Labels

Comments

@kundeng
Copy link

kundeng commented Feb 17, 2020

from sspipe import p, px
from collections import OrderedDict
dict([(1,1),(4,2),(2,3)]).items() | p(sorted) | p(OrderedDict)

@mohammad7t
Copy link
Member

Thank you for the crash report. Unfortunately, python does not allow overriding | operator for dict view objects that are returned by dict.keys, dict.values and dict.items. Please update sspipe to version 0.1.14 and use / operator, instead of |.

I added an example in readme

@mohammad7t
Copy link
Member

mohammad7t commented Feb 18, 2020

the following code works (notice the / operator after items()):
dict([(1,1),(4,2),(2,3)]).items() / p(sorted) | p(OrderedDict)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants