003 File Manager
Current Path:
/usr/local/lib/python3.8/site-packages/zmq/utils
usr
/
local
/
lib
/
python3.8
/
site-packages
/
zmq
/
utils
/
📁
..
📄
__init__.py
(0 B)
📁
__pycache__
📄
buffers.pxd
(6.87 KB)
📄
compiler.json
(310 B)
📄
config.json
(344 B)
📄
constant_names.py
(11.23 KB)
📄
garbage.py
(6.04 KB)
📄
getpid_compat.h
(116 B)
📄
interop.py
(685 B)
📄
ipcmaxlen.h
(522 B)
📄
jsonapi.py
(1018 B)
📄
monitor.py
(2.02 KB)
📄
mutex.h
(1.59 KB)
📄
pyversion_compat.h
(284 B)
📄
strtypes.py
(1.09 KB)
📄
win32.py
(5.08 KB)
📄
z85.py
(1.78 KB)
📄
zmq_compat.h
(3.17 KB)
📄
zmq_constants.h
(18.4 KB)
Editing: strtypes.py
"""Declare basic string types unambiguously for various Python versions. Authors ------- * MinRK """ # Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. import sys bytes = bytes unicode = str basestring = (str,) def cast_bytes(s, encoding='utf8', errors='strict'): """cast unicode or bytes to bytes""" if isinstance(s, bytes): return s elif isinstance(s, unicode): return s.encode(encoding, errors) else: raise TypeError("Expected unicode or bytes, got %r" % s) def cast_unicode(s, encoding='utf8', errors='strict'): """cast bytes or unicode to unicode""" if isinstance(s, bytes): return s.decode(encoding, errors) elif isinstance(s, unicode): return s else: raise TypeError("Expected unicode or bytes, got %r" % s) # give short 'b' alias for cast_bytes, so that we can use fake b('stuff') # to simulate b'stuff' b = asbytes = cast_bytes u = cast_unicode __all__ = [ 'asbytes', 'bytes', 'unicode', 'basestring', 'b', 'u', 'cast_bytes', 'cast_unicode', ]
Upload File
Create Folder