23👍
The problem is in functools.py file. This file is from Python.
To fix the problem replace this (about line 56 in python\Lib\fuctools.py):
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)]
}
to that:
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)]
}
Read also: http://regebro.wordpress.com/2010/12/13/python-implementing-rich-comparison-the-correct-way/
0👍
I removed PyDev, Django and Python and re-installed all of them, and now it works. Thanks!
- [Django]-Django extend admin "index" view
- [Django]-Issue with returning Cyrillic symbols from MSSQL via unixODBC and FreeTDS
- [Django]-Django invite code app recommendation?
- [Django]-Using mongoengine with models.ImageField
- [Django]-Syntax error whenever I put Python code inside a Django template
0👍
I’ve run into this a couple times while using pyenv virtualenvs
with python 2.7.1. I didn’t want to edit core files so I upgraded to 2.7.5 and it worked flawlessly. Hopefully this is an option for some of you.
- [Django]-Allowing basic html markup in django
- [Django]-Django saving form strings in database with extra characters (u'string')
- [Django]-Validation Error with Multiple File Uploads in Django via Ajax
- [Django]-Using a static website generator for a blog on a dynamic website?
Source:stackexchange.com