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

irange() when used with neg #235

Open
oedokumaci opened this issue Apr 2, 2024 · 0 comments
Open

irange() when used with neg #235

oedokumaci opened this issue Apr 2, 2024 · 0 comments

Comments

@oedokumaci
Copy link

I am using SortedDict with neg from operators (so that index 0 is lowest key, value pair). The thing is that when I use irange, I need to swap minimum and maximum values to get what I would normally expect. Is this intended?

MWE below:

bid_prices_and_quantities = SortedDict(neg)
bid_prices_and_quantities[1.5] = 5
bid_prices_and_quantities[2.5] = 4
bid_prices_and_quantities[3] = 3
bid_prices_and_quantities[4] = 2
for price in bid_prices_and_quantities.irange(minimum=2, maximum=3):
    print(price)

this does not print anything.

for price in bid_prices_and_quantities.irange(maximum=2, minimum=3):
    print(price)

this prints as expected:
3
2.5

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

No branches or pull requests

1 participant