Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
32a7e7f6
Commit
32a7e7f6
authored
May 31, 2002
by
Neal Norwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change name from string to basestring
parent
9b414ac9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
Misc/NEWS
Misc/NEWS
+2
-2
Objects/stringobject.c
Objects/stringobject.c
+3
-3
Python/bltinmodule.c
Python/bltinmodule.c
+1
-1
No files found.
Misc/NEWS
View file @
32a7e7f6
...
...
@@ -12,10 +12,10 @@ Core and builtins
deprecations, use -Walways::PendingDeprecationWarning::
as a command line option or warnings.filterwarnings() in code.
- A new type object, 'string', is added. This is a common base type
- A new type object, '
base
string', is added. This is a common base type
for 'str' and 'unicode', and can be used instead of
types.StringTypes, e.g. to test whether something is "a string":
isinstance(x, string) is True for Unicode and 8-bit strings. This
isinstance(x,
base
string) is True for Unicode and 8-bit strings. This
is an abstract base class and cannot be instantiated directly.
- Deprecated features of xrange objects have been removed as
...
...
Objects/stringobject.c
View file @
32a7e7f6
...
...
@@ -2859,17 +2859,17 @@ static PyObject *
basestring_new
(
PyTypeObject
*
type
,
PyObject
*
args
,
PyObject
*
kwds
)
{
PyErr_SetString
(
PyExc_TypeError
,
"The string type cannot be instantiated"
);
"The
base
string type cannot be instantiated"
);
return
NULL
;
}
static
char
basestring_doc
[]
=
"Type string cannot be instantiated; it is the base for str and unicode."
;
"Type
base
string cannot be instantiated; it is the base for str and unicode."
;
PyTypeObject
PyBaseString_Type
=
{
PyObject_HEAD_INIT
(
&
PyType_Type
)
0
,
"string"
,
"
base
string"
,
0
,
0
,
0
,
/* tp_dealloc */
...
...
Python/bltinmodule.c
View file @
32a7e7f6
...
...
@@ -1890,6 +1890,7 @@ _PyBuiltin_Init(void)
SETBUILTIN
(
"NotImplemented"
,
Py_NotImplemented
);
SETBUILTIN
(
"False"
,
Py_False
);
SETBUILTIN
(
"True"
,
Py_True
);
SETBUILTIN
(
"basestring"
,
&
PyBaseString_Type
);
SETBUILTIN
(
"bool"
,
&
PyBool_Type
);
SETBUILTIN
(
"classmethod"
,
&
PyClassMethod_Type
);
#ifndef WITHOUT_COMPLEX
...
...
@@ -1905,7 +1906,6 @@ _PyBuiltin_Init(void)
SETBUILTIN
(
"object"
,
&
PyBaseObject_Type
);
SETBUILTIN
(
"staticmethod"
,
&
PyStaticMethod_Type
);
SETBUILTIN
(
"str"
,
&
PyString_Type
);
SETBUILTIN
(
"string"
,
&
PyBaseString_Type
);
SETBUILTIN
(
"super"
,
&
PySuper_Type
);
SETBUILTIN
(
"tuple"
,
&
PyTuple_Type
);
SETBUILTIN
(
"type"
,
&
PyType_Type
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment