meysam81 / timeframe

Python library datetime wrapper for calculating time ranges, manipulations and calculations
https://pypi.org/project/timeframe/
MIT License
8 stars 1 forks source link

TypeError when BatchTimeFrame is subtracted a Timeframe from within #8

Open PakMichael opened 2 years ago

PakMichael commented 2 years ago
        tf_long = TimeFrame(datetime(2022, 3, 1, 12), datetime(2022, 3, 1, 13))
        tf_a = BatchTimeFrame([tf_long])

        tf_sub_a = TimeFrame(datetime(2022, 3, 1, 12, 30), datetime(2022, 3, 1, 12, 45))
        tf_b = BatchTimeFrame([tf_sub_a])

        print(tf_a - tf_b)  #TypeError: Every iterable element should be a BaseTimeFrame
meysam81 commented 1 year ago

Hey @PakMichael , Thanks for your interest, and sorry for the very long silence. I just saw this a couple of weeks ago.

This issue is quite tricky to address. If you have a good idea for tackling this, please open a PR.