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

Chain-able add_children for easy coding #290

Merged
merged 1 commit into from
May 25, 2020
Merged

Chain-able add_children for easy coding #290

merged 1 commit into from
May 25, 2020

Conversation

iovsiann
Copy link
Contributor

Usage: create, add in single line of code
my_sequence = Sequence('MySequence').add_children([childA, childB]
Original code takes 2 lines to do same:
my_sequence = Sequence('MySequence')
my_sequence.add_children([childA, childB])
PS. I know this can be already done in one line my_sequence = Sequence(name='MySequence', children=[childA, childB]), just suggesting an alternative option

Usage: create, add in single line of code
my_sequence = Sequence('MySequence').add_children([childA, childB]
Original code takes 2 lines to do same:
my_sequence = Sequence('MySequence')
my_sequence.add_children([childA, childB])
PS. I know this can be already done in one line my_sequence = Sequence(name='MySequence', children=[childA, childB]), just suggesting an alternative option
@stonier stonier mentioned this pull request May 25, 2020
@stonier
Copy link
Member

stonier commented May 25, 2020

I generally prefer the constructor api being a clear signal about what needs to be configured, but this certainly isn't going to violate that, nor break anything and lets users roll with their own style. LGTM, thanks!

@stonier stonier merged commit b0d46bb into splintered-reality:devel May 25, 2020
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