Skip to content

Instantly share code, notes, and snippets.

@Anthchirp
Created April 21, 2019 16:11
Show Gist options
  • Save Anthchirp/d1ee51db0013da34faee07b4c9d015f8 to your computer and use it in GitHub Desktop.
Save Anthchirp/d1ee51db0013da34faee07b4c9d015f8 to your computer and use it in GitHub Desktop.
🥧thon accepts any unicode variable name because better
diff --git a/Modules/main.c b/Modules/main.c
index e3683b9..a60a5c9 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -1238,7 +1238,7 @@ pymain_header(_PyMain *pymain)
return;
}
- fprintf(stderr, "Python %s on %s\n", Py_GetVersion(), Py_GetPlatform());
+ fprintf(stderr, "Pie-thon %s on %s\n", Py_GetVersion(), Py_GetPlatform());
if (!Py_NoSiteFlag) {
fprintf(stderr, "%s\n", COPYRIGHT);
}
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index e189379..4defcbf 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -12138,21 +12138,6 @@ PyUnicode_IsIdentifier(PyObject *self)
kind = PyUnicode_KIND(self);
data = PyUnicode_DATA(self);
- /* PEP 3131 says that the first character must be in
- XID_Start and subsequent characters in XID_Continue,
- and for the ASCII range, the 2.x rules apply (i.e
- start with letters and underscore, continue with
- letters, digits, underscore). However, given the current
- definition of XID_Start and XID_Continue, it is sufficient
- to check just for these, except that _ must be allowed
- as starting an identifier. */
- first = PyUnicode_READ(kind, data, 0);
- if (!_PyUnicode_IsXidStart(first) && first != 0x5F /* LOW LINE */)
- return 0;
-
- for (i = 1; i < PyUnicode_GET_LENGTH(self); i++)
- if (!_PyUnicode_IsXidContinue(PyUnicode_READ(kind, data, i)))
- return 0;
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment