Requiring input to be str or List[str]is overly restrictive.

Create issue
Issue #1221 new
Tim Fennell created an issue

I frequently run into cases where I have an input that is defined as a lambda that returns something other than str and then snakemake throws an error that the value is neither str nor a list of strs. I make extensive use of pathlib and almost all functions that deal with filesystem objects in my work return Path. I then have to remember to wrap things everywhere like:

    ref = lambda wc: str(samples[wc.sample].ref_fasta)
    fastqs = lambda wc: [str(f) for f in samples[wc.sample].fastqs]

It would be really nice if snakemake would either allow other common types used to represent filesystem paths, or just take any time (in my limited experience this would seem more pythonic) and use str() to turn it into a string.

Comments (0)

  1. Log in to comment