[issue24053] Define EXIT_SUCCESS and EXIT_FAILURE constants in sys

2018-12-12 Thread Elliot Edmunds


Elliot Edmunds  added the comment:

I have personally come across situations where I am calling a Python script 
from a C program and would like to check the exit codes of the script, and have 
had to write sys.exit(1) and sys.exit(0) in Python, and compared them to 
EXIT_SUCCESS/EXIT_FAILURE in C. It would have been easy to introduce a bug 
where I returned the wrong exit code, so I was hoping they would have been 
implemented in sys.

It seems like a no-brainer to add these, they reduce magic number use and 
improve the accessibility of Python to people coming from C. I would love to 
add these if everyone is OK with it.

--
nosy: +Elliot Edmunds
versions: +Python 3.8 -Python 3.5

___
Python tracker 
<https://bugs.python.org/issue24053>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16438] Numeric operator predecence confusing

2018-09-20 Thread Elliot Edmunds


Elliot Edmunds  added the comment:

I agree that linking to the precedence table is probably the best solution.

A different option would be to add an extra column listing the "priority" and 
rank the priorities of the different operations.

--
nosy: +Elliot Edmunds

___
Python tracker 
<https://bugs.python.org/issue16438>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25433] whitespace in strip()/lstrip()/rstrip()

2018-08-28 Thread Elliot Edmunds


Elliot Edmunds  added the comment:

Not sure how helpful it would be to have the re.sub expressions for lstrip and 
rstrip, but I think it would look like:

l_stripped = re.sub(r'^\s*', '', foo)
r_stripped = re.sub(r'\s*$', '', foo)

--
nosy: +Elliot Edmunds
Added file: https://bugs.python.org/file47769/whitespace_regex.py

___
Python tracker 
<https://bugs.python.org/issue25433>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com