zoukankan      html  css  js  c++  java
  • django startapp报 maximum recursion depth exceeded

    报错截图如下:

    解决办法:修改指定路径下的functools.py文件的def total_ordering(cls):方法:

    原来的样子:

    convert = {
            '__lt__': [('__gt__', lambda self, other: other < self),
                       ('__le__', lambda self, other: not other < self),
                       ('__ge__', lambda self, other: not self < other)],
            '__le__': [('__ge__', lambda self, other: other <= self),
                       ('__lt__', lambda self, other: not other <= self),
                       ('__gt__', lambda self, other: not self <= other)],
            '__gt__': [('__lt__', lambda self, other: other > self),
                       ('__ge__', lambda self, other: not other > self),
                       ('__le__', lambda self, other: not self > other)],
            '__ge__': [('__le__', lambda self, other: other >= self),
                       ('__gt__', lambda self, other: not other >= self),
                       ('__lt__', lambda self, other: not self >= other)]
        }
    

    修改后的样子:

    convert = {  
        '__lt__': [('__gt__', lambda self, other: not (self < other or self == other)),  
                   ('__le__', lambda self, other: self < other or self == other),  
                   ('__ge__', lambda self, other: not self < other)],  
        '__le__': [('__ge__', lambda self, other: not self <= other or self == other),  
                   ('__lt__', lambda self, other: self <= other and not self == other),  
                   ('__gt__', lambda self, other: not self <= other)],  
        '__gt__': [('__lt__', lambda self, other: not (self > other or self == other)),  
                   ('__ge__', lambda self, other: self > other or self == other),  
                   ('__le__', lambda self, other: not self > other)],  
        '__ge__': [('__le__', lambda self, other: (not self >= other) or self == other),  
                   ('__gt__', lambda self, other: self >= other and not self == other),  
                   ('__lt__', lambda self, other: not self >= other)]  
    }  
    

    改完之后即可创建app

      

      

  • 相关阅读:
    ACM-ICPC 2018 焦作赛区网络预赛 H题 String and Times(SAM)
    ACM-ICPC 2018 焦作赛区网络预赛 G题 Give Candies
    ACM-ICPC 2018 焦作赛区网络预赛 B题 Mathematical Curse
    2018ACM/ICPC 焦作网络预选赛-A Magic Mirror
    POJ 1966 Cable TV NETWORK(网络流-最小点割集)
    最大权闭合子图
    HihoCoder 1398 网络流
    UVA11324 The Lagest Lique(SCC缩点+DP)
    POJ 2186 Popular cows(SCC 缩点)
    HDU5394 Bomb
  • 原文地址:https://www.cnblogs.com/phyger/p/8628821.html
Copyright © 2011-2022 走看看