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

Python iterable multiports #713

Merged
merged 3 commits into from
Nov 7, 2021
Merged

Python iterable multiports #713

merged 3 commits into from
Nov 7, 2021

Conversation

Soroosh129
Copy link
Contributor

This makes multiports in the Python target iterable, which makes accessing them more Pythonic.

For example, previously, a multiport could only be iterated on as:

for i in range(len(multiport)):
    print(multiport[i].value)

Now, you could iterate over each port directly:

for port in multiport:
    print(port.value)

@Soroosh129 Soroosh129 changed the base branch from master to python-federated November 2, 2021 23:18
Copy link
Member

@lhstrh lhstrh left a comment

Choose a reason for hiding this comment

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

This is a nice improvement!

@lhstrh lhstrh changed the title Python iteratable multiports Python iterable multiports Nov 3, 2021
@Soroosh129 Soroosh129 mentioned this pull request Nov 4, 2021
Copy link
Collaborator

@cmnrd cmnrd left a comment

Choose a reason for hiding this comment

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

Great idea! Should we merge this?

Base automatically changed from python-federated to master November 7, 2021 05:12
@lhstrh lhstrh merged commit 28e7e38 into master Nov 7, 2021
@Soroosh129 Soroosh129 deleted the python-iteratable-multiports branch November 9, 2021 17:03
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.

3 participants