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

Usage of mutable value in function signature of connect #587

Open
skewty opened this issue Jul 14, 2024 · 1 comment
Open

Usage of mutable value in function signature of connect #587

skewty opened this issue Jul 14, 2024 · 1 comment
Assignees
Labels
accepted The defect or proposal as been accepted enhancement Enhancement to existing functionality

Comments

@skewty
Copy link

skewty commented Jul 14, 2024

Observed behavior

Mutable values in function signatures are bad form in python and should be avoided.

This potential code issue is picked up by most linters. Perhaps Ruff should be leveraged by this project to help catch these issues?

Expected behavior

async def connect(servers: Union[str, List[str]] = ""], **options) -> NATS:
    nc = NATS()
    await nc.connect(servers or "nats://localhost:4222", **options)
    return nc

Server and client version

servers: Union[str, List[str]] = ["nats://localhost:4222"],

Host environment

No response

Steps to reproduce

No response

@skewty skewty added the defect Suspected defect such as a bug or regression label Jul 14, 2024
@caspervonb caspervonb self-assigned this Jul 14, 2024
@caspervonb
Copy link
Contributor

Started moving over to GitHub Actions so we can turn on linting and formatting inline here #568

@caspervonb caspervonb added enhancement Enhancement to existing functionality accepted The defect or proposal as been accepted and removed defect Suspected defect such as a bug or regression labels Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted The defect or proposal as been accepted enhancement Enhancement to existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants