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

Replace "A and B or C" by "B if A else C" #463

Merged
merged 1 commit into from
Feb 25, 2015

Conversation

bcroq
Copy link
Contributor

@bcroq bcroq commented Feb 25, 2015

With "A and B or C", when B is a context (ie a graph), Python implicitly calls Graph:__len__. This call can be quite long, we don't need it.

More informations here: https://docs.python.org/2/reference/datamodel.html#object.__nonzero__

With "A and B or C", when B is a context (ie a graph), Python implicitly calls Graph:__len__. This call can be quite long, we don't need it.

More informations here: https://docs.python.org/2/reference/datamodel.html#object.__nonzero__
@joernhees
Copy link
Member

thanks, seems quite legit and makes the code way more readable and faster

joernhees added a commit that referenced this pull request Feb 25, 2015
Replace "A and B or C" by "B if A else C"
@joernhees joernhees merged commit e0b0259 into RDFLib:master Feb 25, 2015
@joernhees joernhees added this to the rdflib 4.2.1 milestone Feb 25, 2015
@joernhees joernhees added enhancement New feature or request cleanup store Related to a store. labels Feb 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup enhancement New feature or request store Related to a store.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants