<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def partition_targets_by_compatibility(self, targets):
 """Partition targets by their compatibility constraints. :param targets: a list of `PythonTarget` objects :returns: (tgts_by_compatibilities, filters):
 a dict that maps compatibility constraints to a list of matching targets, the aggregate set of compatibility constraints imposed by the target set :rtype: (dict(str, list), set) """

    tgts_by_compatibilities = defaultdict(list)
    filters = set()

    for target in targets:
      if isinstance(target, PythonTarget):
        c = self.python_setup.compatibility_or_constraints(target)
        tgts_by_compatibilities[c].append(target)
        filters.update(c)
    return tgts_by_compatibilities, filters