Skip to content

Usage of mutable value in function signature of connect #587

Open
@skewty

Description

@skewty

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

Metadata

Metadata

Assignees

Labels

acceptedThe defect or proposal as been acceptedenhancementEnhancement to existing functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions