[issue25923] More const char

2015-12-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Excuse my troubling.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue25923] More const char

2015-12-26 Thread Stefan Krah

Stefan Krah added the comment:

There's no need to revert it.  Both versions are okay, but I wanted
to point out that these kinds of changes a) add a cognitive load for
other developers (I have to look what has changed in memoryobject.c)
and b) may override other developers' conscious decisions.

--

___
Python tracker 

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



[issue25923] More const char

2015-12-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3cb3e224b692 by Serhiy Storchaka in branch 'default':
Issue #25923: Added the const qualifier to static constant arrays.
https://hg.python.org/cpython/rev/3cb3e224b692

--
nosy: +python-dev

___
Python tracker 

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



[issue25923] More const char

2015-12-25 Thread Stefan Krah

Stefan Krah added the comment:

What is the point of changing the return value of a function in
Objects/memoryobject.c to "const char *" and then casting it back
to "char *" in the one place that the function is used?

Churn like this has a direct cost for me: I have to update my
private 100% coverage patch for no gain at all.

--
nosy: +skrah

___
Python tracker 

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



[issue25923] More const char

2015-12-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 80d1faa9735d by Serhiy Storchaka in branch 'default':
Issue #25923: Added more const qualifiers to signatures of static and private 
functions.
https://hg.python.org/cpython/rev/80d1faa9735d

--

___
Python tracker 

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



[issue25923] More const char

2015-12-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Sorry. Do you prefer to revert this change or left it as is?

--

___
Python tracker 

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



[issue25923] More const char

2015-12-25 Thread Stefan Krah

Stefan Krah added the comment:

I was faced with the same dilemma when I wrote the code and I
*deliberately* decided that returning (const char *) + an
additional cast wasn't worth it for a static function
that's used only once.

--

___
Python tracker 

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



[issue25923] More const char

2015-12-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

get_native_fmtstr() returns a pointer to C string literal. It is constant by 
its nature, and I thought it would be more clear to cast it explicitly if 
needed. It would be better (in particular for compatibility with C++) to make 
Py_buffer.format to be const char*, since it is borrowed reference to constant 
string, and often is initialized with string literal, but this is backward 
incompatible change of public API. I'm planning to open separate issue for 
backward-incompatible (controlled with a macro) constantness changing.

--

___
Python tracker 

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



[issue25923] More const char

2015-12-22 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch adds the const qualifier to char* parameter declarations and 
static char arrays if appropriate. This makes the code more strict and can help 
to catch bugs or generate more efficient code. In additional it can decrease 
memory consumption by avoiding copying constant data.

--
assignee: serhiy.storchaka
components: Extension Modules, Interpreter Core
files: const_char_ptr.patch
keywords: patch
messages: 256837
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: More const char
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file41384/const_char_ptr.patch

___
Python tracker 

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