[issue23083] sys.exit with bool parameter

2014-12-18 Thread Eric V. Smith
Changes by Eric V. Smith : -- stage: -> resolved ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue23083] sys.exit with bool parameter

2014-12-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: I agree that the docs are best as-is. -- nosy: +rhettinger resolution: -> rejected status: open -> closed ___ Python tracker ___ ___

[issue23083] sys.exit with bool parameter

2014-12-18 Thread R. David Murray
R. David Murray added the comment: Hmm. Good point about the anti-pattern. I agree that it is probably best to leave the docs as they are. -- ___ Python tracker ___ __

[issue23083] sys.exit with bool parameter

2014-12-18 Thread Eric V. Smith
Eric V. Smith added the comment: I'm not sure this should be documented. It follows from int and bool equivalence. Plus, I consider it an anti-pattern. We don't want to document everywhere you can pass a bool where an int is called for. That's thousands of places. -- nosy: +eric.smith

[issue23083] sys.exit with bool parameter

2014-12-18 Thread R. David Murray
R. David Murray added the comment: >>> issubclass(bool, int) True >>> True == 1 True [41846 refs] >>> False == 0 True This is fundamental to Python, so it is not obvious that it is a good idea to mention bool explicitly in the sys.exit docs. Perhaps we could change it to say "int (or an int s

[issue23083] sys.exit with bool parameter

2014-12-18 Thread Polux Moon
New submission from Polux Moon: when using a bool as parameter implementation (2.7) behave like: sys.exit(True) <=> sys.exit(1) sys.exit(False) <=> sys.exit(0) so the bool indicate if the termination is abnormal following the doc it should be equivalent to sys.exit(1) in all cases if we assume