Nick Coghlan <ncogh...@gmail.com> added the comment:

It isn't InitVar that you want for that use case (that's just for passing extra 
information to __post_init__).

Instead, you want:

    extra_field = field(compare=False): int # Excluded from __hash__, __eq_, etc

You can also exclude a field from __hash__, but keep it in the comparison 
methods:

    unhashed_field = field(hash=False): int # Excluded from __hash__ only

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue20632>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to