def target_factory(spec_string, target_concrete): spec = Spec(spec_string) if target_concrete: spec._mark_concrete() substitute_abstract_variants(spec) return spec
def make_spec(spec_like, concrete): if isinstance(spec_like, Spec): return spec_like spec = Spec(spec_like) if concrete: spec._mark_concrete() substitute_abstract_variants(spec) return spec