summaryrefslogtreecommitdiffstats
path: root/Misc/NEWS
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-08-19 21:43:18 (GMT)
committerGuido van Rossum <guido@python.org>2002-08-19 21:43:18 (GMT)
commit45ec02aed14685c353e55841b5acbc0dadee76f8 (patch)
tree0c146fdf0d488f279f0baf64b0f1fa0484274a73 /Misc/NEWS
parentd8dbf847b6a819ef73d7bf0c05eafbdb9aee9956 (diff)
downloadcpython-45ec02aed14685c353e55841b5acbc0dadee76f8.zip
cpython-45ec02aed14685c353e55841b5acbc0dadee76f8.tar.gz
cpython-45ec02aed14685c353e55841b5acbc0dadee76f8.tar.bz2
SF patch 576101, by Oren Tirosh: alternative implementation of
interning. I modified Oren's patch significantly, but the basic idea and most of the implementation is unchanged. Interned strings created with PyString_InternInPlace() are now mortal, and you must keep a reference to the resulting string around; use the new function PyString_InternImmortal() to create immortal interned strings.
Diffstat (limited to 'Misc/NEWS')
-rw-r--r--Misc/NEWS17
1 files changed, 17 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index d60205e..7034d72 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -57,6 +57,10 @@ Type/class unification and new-style classes
Core and builtins
+- A subtle change to the semantics of the built-in function intern():
+ interned strings are no longer immortal. You must keep a reference
+ to the return value intern() around to get the benefit.
+
- Use of 'None' as a variable, argument or attribute name now
issues a SyntaxWarning. In the future, None may become a keyword.
@@ -514,6 +518,19 @@ Build
C API
+- The string object's layout has changed: the pointer member
+ ob_sinterned has been replaced by an int member ob_sstate. On some
+ platforms (e.g. most 64-bit systems) this may change the offset of
+ the ob_sval member, so as a precaution the API_VERSION has been
+ incremented. The apparently unused feature of "indirect interned
+ strings", supported by the ob_sinterned member, is gone. Interned
+ strings are now usually mortal; theres a new API,
+ PyString_InternImmortal() that creates immortal interned strings.
+ (The ob_sstate member can only take three values; however, while
+ making it a char saves a few bytes per string object on average, in
+ it also slowed things down a bit because ob_sval was no longer
+ aligned.)
+
- The Py_InitModule*() functions now accept NULL for the 'methods'
argument. Modules without global functions are becoming more common
now that factories can be types rather than functions.