Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 17ca992 commit e8811f8Copy full SHA for e8811f8
1 file changed
Python/bltinmodule.c
@@ -840,6 +840,19 @@ builtin_input(self, args)
840
return res;
841
}
842
843
+static PyObject *
844
+builtin_intern(self, args)
845
+ PyObject *self;
846
+ PyObject *args;
847
+{
848
+ PyObject *s;
849
+ if (!PyArg_ParseTuple(args, "S", &s))
850
+ return NULL;
851
+ Py_INCREF(s);
852
+ PyString_InternInPlace(&s);
853
+ return s;
854
+}
855
+
856
static object *
857
builtin_int(self, args)
858
object *self;
@@ -1558,6 +1571,7 @@ static struct methodlist builtin_methods[] = {
1558
1571
{"hex", builtin_hex, 1},
1559
1572
{"id", builtin_id, 1},
1560
1573
{"input", builtin_input, 1},
1574
+ {"intern", builtin_intern, 1},
1561
1575
{"int", builtin_int, 1},
1562
1576
{"len", builtin_len, 1},
1563
1577
{"list", builtin_list, 1},
0 commit comments