镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Rename variable a to __a or similar? #102

Description

@mandarm

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.

Activity

  1. dhellmann commented on Jul 5, 2024

    @dhellmann
    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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions