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

Don't include the namespace in the import's name for hy models. #1644

Closed
gilch opened this issue Jun 25, 2018 · 3 comments · Fixed by #2031
Closed

Don't include the namespace in the import's name for hy models. #1644

gilch opened this issue Jun 25, 2018 · 3 comments · Fixed by #2031

Comments

@gilch
Copy link
Member

gilch commented Jun 25, 2018

Brandon Rhodes expressed it well at PyCon
https://youtu.be/x-kB2o8sd5c?t=1048

In his example,

import piano
piano.Bench()      # yes!

Is preferable to

import piano
piano.PianoBench()  # no!

We should not bake the namespace into the name itself.

Similarly for the Hy models, we should have

hy.List
hy.Expression
hy.Dict

etc. not

hy.HyList
hy.HyExpression
hy.HyDict

like we have now.

@Kodiologist
Copy link
Member

Contrast with #1045.

@refi64
Copy link
Contributor

refi64 commented Jun 25, 2018

We could always import hy automatically, which also pollute the global scope a bit less.

@gilch
Copy link
Member Author

gilch commented Jun 26, 2018

We could also leave eval in there but not auto import from hy.core.language import eval like we do now.

Then Hy's eval would be hy.eval, (not hy.hy-eval) and Python's builtin would just be eval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants