<@U06A03HV1>: re <https://github.com/pantsbuild/p...
# development
w
@witty-crayon-22786: re https://github.com/pantsbuild/pants/issues/3169, am i on the right track?
Copy code
class Collection(object):
  @classmethod
  @memoized
  def of(cls, ext):
    type_name = b'Collection({!r})'.format(ext)

    class_dict = {'ext': ext,
                  # # We need custom serialization for the dynamic class type.
                  # '__reduce__': lambda self: (_create_sources, ext)
                  }

    ext_type = type(type_name, (cls, datatype("{}s".format(ext.__name__), ['dependencies'])), class_dict)

    # Expose the custom class type at the module level to be pickle compatible.
    setattr(sys.modules[cls.__module__], type_name, ext_type)

    return ext_type
    
    
Files = Collection.of(File)
Dirs = Collection.of(Dir)

def create_fs_tasks():
  """Creates tasks that consume the native filesystem Node type."""
  return [
    # Glob execution.
    (Stats,
     [SelectProjection(Stats, Dir, ('directory',), PathWildcard),
      Select(PathWildcard)],
     apply_path_wildcard),…