Re: if bytes != str:

2019-08-04 Thread Jon Ribbens via Python-list
_bytes(s): > if bytes != str: > if type(s) == str: > return s.encode('utf-8') > return s > > def to_str(s): > if bytes != str: > if type(s) == bytes: > return s.decode('u

Re: if bytes != str:

2019-08-04 Thread Ian Kelly
/ssrlink.py> > > In this script, there are the following two customized functions: > > > -- > def to_bytes(s): > if bytes != str: > if type(s) == str: > return s.encode('utf-8') > return s >

Re: if bytes != str:

2019-08-04 Thread Dan Sommers
On 8/4/19 10:56 AM, Hongyi Zhao wrote: Hi, I read and learn the the following code now: https://github.com/shadowsocksr-backup/shadowsocksr-libev/blob/master/src/ ssrlink.py In this script, there are the following two customized functions: -- def to_bytes(s): if bytes != str

if bytes != str:

2019-08-04 Thread Hongyi Zhao
Hi, I read and learn the the following code now: https://github.com/shadowsocksr-backup/shadowsocksr-libev/blob/master/src/ ssrlink.py In this script, there are the following two customized functions: -- def to_bytes(s): if bytes != str: if type(s) == str