https://pantsbuild.org/ logo
#development
Title
# development
h

hundreds-breakfast-49010

09/17/2020, 1:11 AM
re: https://github.com/pantsbuild/pants/pull/10797 , why do have a distinction between
Key
and
Value
to begin with?
h

hundreds-father-404

09/17/2020, 1:15 AM
Stu was DMing me this today, and realized it shouldn’t have been DM hehe The difference is that a
Key
corresponds to a “Param”, meaning it must have hash and eq. A
Value
corresponds to a positional arg to a rule or an
await Get
, iiuc, and only needs
__eq__
👍 1
h

hundreds-breakfast-49010

09/17/2020, 1:19 AM
I"m thinking about stu's reply on that issue now. I see his point about
PathGlobs
being a potentially large type (although maybe not that potentially large, before it's parsed)
👍 1
I do think it makes sense that
Snapshot
should include some inner type that's more specific than `Key`; one that makes it clear that the python object contianed within has already been parsed and guaranteed to actually be a
PathGlobs
and this is orthogonal to his point about how
DIsplay
for
Key
should actually be Python
__repr__
even if that results in a long string
h

hundreds-father-404

09/17/2020, 1:21 AM
although maybe not that potentially large,
Maybe, although definitely minimizing FFI is valuable. Performance is the raison d’être for Pants.
h

hundreds-breakfast-49010

09/17/2020, 1:22 AM
it also might make sense to rename
Key
to make that distinction clearer, or at least document it with a docstring; I didn't know that until now
👍 1
but that's yet another orthogonal problem
w

witty-crayon-22786

09/17/2020, 7:02 PM
Value
 corresponds to a positional arg to a rule or the output value of an 
await Get
, iiuc, and only needs 
__eq__
^ fixed the above. the input to a
Get
is a
Key
, because it becomes a
Param
… the output of a
Get
is a
Value
👍 1