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

Impossible to set closed interval bounds explicitly with replace #40

Closed
TimBergner opened this issue Sep 16, 2020 · 3 comments
Closed

Comments

@TimBergner
Copy link

Other than specified in the documentation it is impossible to set closed interval bounds explicitly with replace (at least I can't). When an interval boundary is closed, it remains closed unless you want to set it explicitly closed.
Example:

>>> i = P.closedopen(0, 2)
>>> i.replace()
[0,2)
>>> i.replace(left=P.CLOSED)
(0,2)
>>> i.replace(left=lambda v: P.CLOSED)
(0,2)
>>> i.replace(lower=1)
[1,2)
@AlexandreDecan
Copy link
Owner

Hello,

Could you tell me which version of portion you're using? When I execute your code snippet, I got:

>>> i = P.closedopen(0, 2)
>>> i.replace()
[0,2)
>>> i.replace(left=P.CLOSED)
[0,2)
>>> i.replace(left=lambda v: P.CLOSED)
[0,2)
>>> i.replace(lower=1)
[1,2)

... which is the desired behaviour.

Thanks

@TimBergner
Copy link
Author

TimBergner commented Sep 16, 2020

Ups. I can't reproduce the behavior now in a new instance of the IPython console. So I probably overwrote some variables or something like that.

Sorry for this issue! Even if the error was reproducible also after reloading portion while running the same iPython instance, I should have tested it again in a new instance - my fault.

Edit: It was the current version 2.1.2 but that probably doesn't matter anymore

@AlexandreDecan
Copy link
Owner

Don't worry ;) I'm glad it's not a new bug :-)

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

2 participants