Skip to content

Rename variable a to __a or similar? #102

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

Open
mandarm opened this issue Jul 2, 2024 · 1 comment
Open

Rename variable a to __a or similar? #102

mandarm opened this issue Jul 2, 2024 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@mandarm
Copy link

mandarm commented Jul 2, 2024

The virtualenvwrapper.sh shell assigns to a as a variable in 4 lines: 430 712 1111 1218 (as far as I can tell).

I use a as a variable myself. Given that it is a simple, short variable, it is likely that other people do too.

Would it be ok to rename all occurrences of a to __a or __aa or something similar to reduce the chance of interfering with user-defined variables?

Alternative strategy:

__saved_a=$a # at the beginning of the script
a=$__saved_a # restore the value at the end

If either of these sound reasonable, I'd be happy to send a PR.

@dhellmann
Copy link
Contributor

If those are all in functions, we should be using typeset to declare the variable as local to that function. It's definitely a bug in virtualenvwrapper if we are not.

@dhellmann dhellmann added bug Something isn't working good first issue Good for newcomers labels Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants