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

Increase the cases detected by dangerous-default-value (W0102) ? #9435

Closed
JonJagger opened this issue Feb 14, 2024 · 1 comment
Closed

Increase the cases detected by dangerous-default-value (W0102) ? #9435

JonJagger opened this issue Feb 14, 2024 · 1 comment
Labels
Duplicate 🐫 Duplicate of an already existing issue

Comments

@JonJagger
Copy link

Current problem

W0102 detects a default value such as [ ]
For example, from the docs:

def whats_on_the_telly(penguin=[]):
    penguin.append("property of the zoo")
    return penguin

Consider the following example:

import time
def whats_on_the_telly(timestamp=time.time()):    
    pass

Is it reasonable that any default expression that is a function call
should be detected as a dangerous-default-value / dangerous-default-expression ?

P.S. pylint is great :-)

Desired solution

Any default expression that is a function call is detected as a dangerous-default-value / dangerous-default-expression

Additional context

No response

@JonJagger JonJagger added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Feb 14, 2024
@JonJagger JonJagger changed the title Increase the cases detected by W0102 dangerous-default-value ? Increase the cases detected by (W0102) dangerous-default-value ? Feb 14, 2024
@JonJagger JonJagger changed the title Increase the cases detected by (W0102) dangerous-default-value ? Increase the cases detected by dangerous-default-value (W0102) ? Feb 14, 2024
@Pierre-Sassoulas
Copy link
Member

Pierre-Sassoulas commented Feb 14, 2024

Thank you for opening an issue and your interest in pylint. This is a duplicate of #4659 which have an open PR that need take over (#8553)

@Pierre-Sassoulas Pierre-Sassoulas closed this as not planned Won't fix, can't repro, duplicate, stale Feb 14, 2024
@Pierre-Sassoulas Pierre-Sassoulas added Duplicate 🐫 Duplicate of an already existing issue and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate 🐫 Duplicate of an already existing issue
Projects
None yet
Development

No branches or pull requests

2 participants