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

Change mangling for leading hyphen #2005

Closed
scauligi opened this issue Mar 17, 2021 · 2 comments
Closed

Change mangling for leading hyphen #2005

scauligi opened this issue Mar 17, 2021 · 2 comments

Comments

@scauligi
Copy link
Member

As brought up in #1993, the single underscore is a frequent idiom in python and would shadow the subtraction operator.

I propose that leading (and trailing?) hyphens be mangled like other characters, and only inner hyphens be mangled to underscores.

This means that e.g. --init-- is no longer the same thing as __init__, but using hyphens for dunders (and for private names) was nominally against Hy's style guide anyway.

This also means that (import [module [*]]) can pick up on symbols like - or -> without having to use __all__, since they no longer have leading underscores.

@peaceamongworlds
Copy link
Contributor

This seems to be the same as #1635

@Kodiologist
Copy link
Member

I agree. That's the right issue for discussing changes to hyphen mangling. Its title can be changed to taste.

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

No branches or pull requests

3 participants