Skip to content

Commit

Permalink
Document address storage in AsyncFieldMixin. (pantsbuild#11448)
Browse files Browse the repository at this point in the history
Without a note there is every reason to undo storage in AsyncFieldMixin
and push the address into Field in a refactoring commit.
  • Loading branch information
jsirois authored Jan 11, 2021
1 parent 98e4e50 commit 0d07a4b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/python/pants/engine/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ def __init__(self, raw_value: Optional[Any], *, address: Address) -> None:
# We must temporarily unfreeze the field, but then we refreeze to continue avoiding
# subclasses from adding arbitrary fields.
self._unfreeze_instance() # type: ignore[attr-defined]
# N.B.: We store the address here and not in the Field base class, because the memory usage
# of storing this value in every field was shown to be excessive / lead to performance
# issues.
self.address = address
self._freeze_instance() # type: ignore[attr-defined]

Expand Down

0 comments on commit 0d07a4b

Please sign in to comment.