A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2017-November/150857.html below:

[Python-Dev] Second post: PEP 557, Data Classes

[Python-Dev] Second post: PEP 557, Data ClassesEric V. Smith eric at trueblade.com
Sun Nov 26 15:22:56 EST 2017
On 11/26/2017 1:04 PM, Brett Cannon wrote:
>     The only open issues I know of are:
>     - Should object comparison require an exact match on the type?
>     https://github.com/ericvsmith/dataclasses/issues/51
> 
> 
> I say don't require the type comparison for duck typing purposes.

The problem with that is that you end up with cases like this, which I 
don't think we want:

@dataclass
class Point:
     x: int
     y: int

@dataclass
class Point3d:
     x: int
     y: int
     z: int

assert Point(1, 2) == Point3d(1, 2, 3)

Eric.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4