MCPcopy Create free account
hub / github.com/ZeroIntensity/pointers.py / make_char

Function make_char

src/pointers/bindings.py:438–457  ·  view source on GitHub ↗
(char: CharLike)

Source from the content-addressed store, hash-verified

436
437
438def make_char(char: CharLike) -> bytes:
439 if isinstance(char, int):
440 return chr(char).encode()
441
442 charp = make_string(char)
443 string = (
444 charp
445 if not isinstance(
446 charp,
447 ctypes.c_char_p,
448 )
449 else _not_null(charp.value)
450 )
451
452 if len(string) != 1:
453 raise InvalidBindingParameter(
454 f'"{string.decode()}" should have a length of 1',
455 )
456
457 return string
458
459
460def isalnum(c: CharLike) -> int:

Callers 15

from_contiguousMethod · 0.85
is_contiguousMethod · 0.85
to_contiguousMethod · 0.85
get_contiguousMethod · 0.85
double_to_stringMethod · 0.85
isalnumFunction · 0.85
isalphaFunction · 0.85
iscntrlFunction · 0.85
isdigitFunction · 0.85
isgraphFunction · 0.85
islowerFunction · 0.85

Calls 5

make_stringFunction · 0.85
_not_nullFunction · 0.85
encodeMethod · 0.80
decodeMethod · 0.45

Tested by

no test coverage detected