Issue16321
Created on 2012-10-25 09:29 by serhiy.storchaka, last changed 2022-04-11 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| 16321.patch | moijes12, 2013-03-07 09:33 | review | ||
| Messages (7) | |||
|---|---|---|---|
| msg173749 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2012-10-25 09:29 | |
The Objects/stringlib directory used for "templates" which instantiates for specified bytes or unicode kinds. Objects/stringlib/eq.h has no relation to this "templates" and should be moved out (as Objects/unicode_eq.h for example). Also it should be removed from Include/Python.h. It used only in Objects/dictobject.c and Objects/setobject.c, and included there directly. |
|||
| msg183646 - (view) | Author: moijes12 (moijes12) | Date: 2013-03-07 09:33 | |
Changes made according to the Sehiy's last comment. Include/Python.h has not been modified as it doesn't need one. Also, make files have been changed. |
|||
| msg183720 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2013-03-08 01:42 | |
I don't understand why do we have specialized functions to compare strings. Can't we reuse PyUnicode_Compare(a, b) or PyUnicode_RichCompare( a, b, Py_EQ)? Is unicode_eq() used to inline the code? By the way, unicode_compare_eq() (subfunction of these functions) and unicode_eq() have a different implementation. unicode_eq() checks the first byte before calling memcmp(). We should only have one implementation, the fastest if possible :-) See also issue #16286. |
|||
| msg185971 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2013-04-03 22:11 | |
Issue #17628 proposes a patch which reuses unicode_eq() in PyUnicode_RichCompare. |
|||
| msg396223 - (view) | Author: Irit Katriel (iritkatriel) * ![]() |
Date: 2021-06-21 10:33 | |
Some of this cleanup was done but we still have unicode_eq in Objects/stringlib/eq.h which is only used in Objects/dictobject.c. |
|||
| msg397036 - (view) | Author: Srinivas Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) (thatiparthy) * | Date: 2021-07-06 10:47 | |
To add irit's comment, It is *also* used in Objects/unicodeobject.c |
|||
| msg397166 - (view) | Author: Raymond Hettinger (rhettinger) * ![]() |
Date: 2021-07-08 19:35 | |
The remaining unicode_eq can be left as-is. While it is only in dictobject.c, the requisite knowledge of string internals makes it reasonable to keep it in stringlib. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:57:37 | admin | set | github: 60525 |
| 2021-07-08 19:35:43 | rhettinger | set | status: open -> closed resolution: fixed messages: + msg397166 stage: needs patch -> resolved |
| 2021-07-06 10:47:06 | thatiparthy | set | nosy:
+ thatiparthy messages: + msg397036 |
| 2021-06-21 10:33:34 | iritkatriel | set | versions:
+ Python 3.11, - Python 3.4 nosy: + iritkatriel messages: + msg396223 |
| 2014-01-05 05:32:00 | moijes12 | set | nosy:
- moijes12 |
| 2013-04-03 22:11:25 | vstinner | set | messages: + msg185971 |
| 2013-03-11 16:30:38 | serhiy.storchaka | set | nosy:
+ rhettinger |
| 2013-03-08 01:42:58 | vstinner | set | messages: + msg183720 |
| 2013-03-07 09:33:02 | moijes12 | set | files:
+ 16321.patch nosy:
+ moijes12 keywords: + patch |
| 2012-10-25 09:29:39 | serhiy.storchaka | create | |
