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

IS this code reachable? #350

Closed
chris-ha458 opened this issue Sep 28, 2023 · 1 comment · Fixed by #352
Closed

IS this code reachable? #350

chris-ha458 opened this issue Sep 28, 2023 · 1 comment · Fixed by #352

Comments

@chris-ha458
Copy link

https://github.com/Ousret/charset_normalizer/blob/58f69f76983fc2042b4f47037c02d2d74ecec2cc/charset_normalizer/models.py#L58C16-L58C78

The outer if would mean that coherence_difference > 0.02
The inner if would require that self.coherence == other.coherence, in other words coherence_difference == 0.0

Am I misunderstanding the code? or was there a mistake here?

@Ousret
Copy link
Member

Ousret commented Sep 30, 2023

Good catch.
This piece of code was intended for some edge cases. And could not have possibly run.
I issued a fix.

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

Successfully merging a pull request may close this issue.

2 participants