feat:support parse boolean from characters 0 and 1

This commit is contained in:
vimiix 2023-06-26 11:35:55 +08:00
parent 9f020124f8
commit 5f7cbe86f2
No known key found for this signature in database
GPG Key ID: 345EB368A98A9E59

View File

@ -97,11 +97,13 @@ typecast_BOOLEAN_cast(const char *s, Py_ssize_t len, PyObject *curs)
if (s == NULL) { Py_RETURN_NONE; }
switch (s[0]) {
case '1':
case 't':
case 'T':
res = Py_True;
break;
case '0':
case 'f':
case 'F':
res = Py_False;