Skip to content

Commit

Permalink
add som notes
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmicexplorer committed Jun 7, 2018
1 parent 3843d5f commit f42f61e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _setup_py_native_tools(self):
native_toolchain = NativeToolchain.scoped_instance(self)
return self._request_single(SetupPyNativeTools, native_toolchain)

# TODO: This should probably be made into a class property, when that is made.
# TODO: This should probably be made into an @classproperty (see PR #5901).
@property
def cache_target_dirs(self):
return True
Expand Down
2 changes: 2 additions & 0 deletions src/python/pants/util/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,14 @@ def satisfied_by_type(self, obj_type):

class Collection(object):
"""Constructs classes representing collections of objects of a particular type."""
# TODO: could we check that the input is iterable in the ctor?

@classmethod
@memoized
def of(cls, *element_types):
union = '|'.join(element_type.__name__ for element_type in element_types)
type_name = b'{}.of({})'.format(cls.__name__, union)
# TODO: could we allow type checking in the datatype() invocation here?
supertypes = (cls, datatype(['dependencies'], superclass_name='Collection'))
properties = {'element_types': element_types}
collection_of_type = type(type_name, supertypes, properties)
Expand Down

0 comments on commit f42f61e

Please sign in to comment.