Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Error on .add method #45

@LuckyExplorer88

Description

@LuckyExplorer88

There is a recursive error (probably on line 60 of file moment/date.py you have to return in order to avoid the replication of the operation). I add to you two examples, the first shows the error with moment, the second abstracts the error in a python primitive way.

import moment

start = moment.date('2021-12-01T18:49:25.902586+0000').locale('utc')

print(start.add(days=30).datetime)
class Tester:

    def __init__(self):
        self.ab = 1

    def test(self, i=0):
        if i == 0:
            for x in ['test']:
                self.test(i=1)

        self.ab += 1

        return self


t = Tester()

print(t.test().ab)

I used "probably" above because the problem seems to appear and disappear without any logic.

Screenshot_code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions