RuntimeError: maximum recursion depth exceeded while calling a Python object

2018. 3. 18. 15:06· Python/Django
반응형

Django 프로젝트, 앱 생성시 아래와 같은 에러가 발생할 경우


File "C:\Python27\Lib\functools.py", line 56, in <lambda>

    '__lt__': [('__gt__', lambda self, other: other < self),

RuntimeError: maximum recursion depth exceeded while calling a Python object


C:\Python27\Lib\functools.py 에 Convert 부분을 다음과 같이 변경해 주면 된다.

def total_ordering(cls):
"""Class decorator that fills in missing ordering methods"""
# 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)]

}


반응형
저작자표시 비영리 변경금지

'Python > Django' 카테고리의 다른 글

[Python][Django] settings.py 의 템플릿 로딩 API  (0) 2019.01.08
[Python][Django] Template Tag < For >  (0) 2019.01.07
[Python][Django] TypeError : ~ is not JSON serializable 해결 방법  (0) 2019.01.03
Windows Apache 설정  (0) 2018.03.16
[Django][orm] Date format  (0) 2018.01.22
'Python/Django' 카테고리의 다른 글
  • [Python][Django] Template Tag < For >
  • [Python][Django] TypeError : ~ is not JSON serializable 해결 방법
  • Windows Apache 설정
  • [Django][orm] Date format
S0PH1A
S0PH1A
반응형
S0PH1A
Web Programmer
S0PH1A
전체
오늘
어제
  • 전체
    • About Me
    • Python
      • Python
      • Django
    • DataBase
      • MySQL
      • MongoDB
    • JAVA
      • JAVA
      • Spring
    • WEB
      • JavaScript
      • HTML
      • CSS
      • Vue.js
      • React
      • Nest.js
      • Node.js
      • Electron
      • PHP
    • Linux
    • Algorithm
    • 기타
    • 생각
    • App
      • ReactNative

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • mysql
  • vue
  • nodejs
  • Error
  • install
  • Python
  • electron
  • django
  • javascript
  • vue.js

최근 댓글

최근 글

hELLO · Designed By 정상우.v4.2.2
S0PH1A
RuntimeError: maximum recursion depth exceeded while calling a Python object
상단으로

티스토리툴바

개인정보

  • 티스토리 홈
  • 포럼
  • 로그인

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.