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

Allow import reassignments using as #245

Closed
irh opened this issue Oct 2, 2023 · 0 comments · Fixed by #274
Closed

Allow import reassignments using as #245

irh opened this issue Oct 2, 2023 · 0 comments · Fixed by #274
Labels
enhancement New feature or request syntax Issues related to Koto's syntax

Comments

@irh
Copy link
Contributor

irh commented Oct 2, 2023

It's currently possible to rename imported items by reassigning them with a new name:

rng_bool = from random import bool

This isn't bad, but it becomes unwieldy when reassigning multiple items:

rng_bool, rng_number = from random import bool, number

Introducing as would allow for inline reassignment, which is more straightforward, and will be less error prone for more complex import expressions.

from random import bool as rng_bool, number as rng_number
@irh irh added enhancement New feature or request syntax Issues related to Koto's syntax labels Oct 2, 2023
@irh irh closed this as completed in #274 Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request syntax Issues related to Koto's syntax
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant