Skip to content

.wait return self so it can be used with method-chaining#379

Merged
eriknw merged 4 commits into
python-graphblas:mainfrom
eriknw:chain_wait
Feb 8, 2023
Merged

.wait return self so it can be used with method-chaining#379
eriknw merged 4 commits into
python-graphblas:mainfrom
eriknw:chain_wait

Conversation

@eriknw

@eriknw eriknw commented Feb 2, 2023

Copy link
Copy Markdown
Member

I've wanted method chaining like this for wait a few times in the past few months.

@coveralls

coveralls commented Feb 2, 2023

Copy link
Copy Markdown

Coverage Status

Coverage: 99.48% (+0.0001%) from 99.48% when pulling 92da690 on eriknw:chain_wait into ed6f3ba on python-graphblas:main.

@eriknw

eriknw commented Feb 3, 2023

Copy link
Copy Markdown
Member Author

This raises the question whether we should do the same for build, clear, and/or resize.

@eriknw

eriknw commented Feb 4, 2023

Copy link
Copy Markdown
Member Author

Nevermind, expressions shouldn't (and don't) have build/clear/resize, so these shouldn't return self. expr.wait() doesn't actually modify the object, so having val = expr.wait() can be a nice shorthand for val = expr.new().wait().

@eriknw eriknw merged commit 1bbce69 into python-graphblas:main Feb 8, 2023
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.

2 participants