| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Looks good!
Sorry, something went wrong.
|
Those look great, @rhettinger! Thanks. I'll do a detailed code review then commit it. |
Sorry, something went wrong.
* main: CI: Temporarily skip paths with spaces to avoid error (python#105110) pythongh-105071: add missing versionadded directive (python#105097) pythongh-80064: Fix is_valid_wide_char() return type (python#105099) Small speedup for dataclass __eq__ and __repr__ (python#104904) pythongh-103921: Minor PEP-695 fixes to the `ast` module docs (python#105093) pythongh-105091: stable_abi.py: Remove "Unixy" check from --all on other platforms (pythonGH-105092)
|
I belive I found a regression: #116647 |
Sorry, something went wrong.
|
Or you found that this resulted in a perhaps inadvertent bugfix ;-). Depends on Eric's intention for NANs in dataclasses. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Old code:
def __eq__(self,other): if other.__class__ is self.__class__: return (self.a,self.b,)==(other.a,other.b,) def __repr__(self): return self.__class__.__qualname__ + f"(a={self.a!r}, b={self.b!r})"New code:
def __eq__(self,other): if other.__class__ is self.__class__: return self.a==other.a and self.b==other.b def __repr__(self): return f"{self.__class__.__qualname__}(a={self.a!r}, b={self.b!r})"Timings for a dataclass with two integer fields:
Both Equal First Equal Neither Equal Repr ========== =========== ============= ============ Baseline 0.09769874 0.10188975 0.10144600 0.18586733 With PR 0.08537712 0.08647508 0.070007080 0.18308112