Skip to content

Allow adding attributes at the end of the list#1807

Merged
s-t-e-v-e-n-k merged 2 commits intoPyGithub:masterfrom
karsten-wagner:pygithub-1806
Mar 23, 2021
Merged

Allow adding attributes at the end of the list#1807
s-t-e-v-e-n-k merged 2 commits intoPyGithub:masterfrom
karsten-wagner:pygithub-1806

Conversation

@karsten-wagner
Copy link
Copy Markdown
Contributor

@karsten-wagner karsten-wagner commented Dec 29, 2020

This intents to fix #1806

Fixes #1806

added = False

inInit = False
inInit = True if line == " def _initAttributes(self):" else False
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awkward. How about?

inInit = line.endswith("def _initAttributes(self):")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@s-t-e-v-e-n-k , sure - updated.
What a pitty, there are so view chances to use ternary operators...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha! I am not against them, but only when absolutely required :-)

@s-t-e-v-e-n-k s-t-e-v-e-n-k merged commit 0245b75 into PyGithub:master Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding new attribute fails in case new name is the last in the list

2 participants