python-internals

Why is gunicorn calling sys.exit(1)?

拈花ヽ惹草 提交于 2020-08-24 05:09:12
问题 Gunicorn is sometimes crashing my server, actually exiting the Python interpreter with sys.exit(1) ! Why is this? Note that the failure is not always at the same point. In the two cases shown below, there is a different last codeline before gunicorn's exit . This code running here is openpyxl , which should not be causing interpreter shutdown! Is the server running out of memory? Some other cause? (This is Flask on Gunicorn on Docker in Google Container Engine.) Case 1 File "/virtualenv_for

Returning NotImplemented from __eq__

▼魔方 西西 提交于 2020-08-19 06:08:46
问题 What's the result of returning NotImplemented from __eq__ special method in python 3 (well 3.5 if it matters)? The documentation isn't clear; the only relevant text I found only vaguely refers to "some other fallback": When NotImplemented is returned, the interpreter will then try the reflected operation on the other type, or some other fallback, depending on the operator. If all attempted operations return NotImplemented , the interpreter will raise an appropriate exception. See Implementing

Returning NotImplemented from __eq__

风格不统一 提交于 2020-08-19 06:08:08
问题 What's the result of returning NotImplemented from __eq__ special method in python 3 (well 3.5 if it matters)? The documentation isn't clear; the only relevant text I found only vaguely refers to "some other fallback": When NotImplemented is returned, the interpreter will then try the reflected operation on the other type, or some other fallback, depending on the operator. If all attempted operations return NotImplemented , the interpreter will raise an appropriate exception. See Implementing