1. 程式人生 > >ascii()bin()breakpoint()callable()-Learn English in Python bultins 2018-10-4

ascii()bin()breakpoint()callable()-Learn English in Python bultins 2018-10-4

```python

def ascii(*args, **kwargs): # real signature unknown """ Return an ASCII-only representation of an object.

As repr(), return a string containing a printable representation of an
object, but escape the non-ASCII characters in the string returned by
repr() using \\x, \\u or \\U escapes. This generates a string similar
to that returned by repr() in Python 2.
"""
pass

def bin(*args, **kwargs): # real signature unknown; NOTE: unreliably restored from doc """ Return the binary representation of an integer.

   >>> bin(2796202)
   '0b1010101010101010101010'
"""
pass

def breakpoint(*args, **kws): # real signature unknown; restored from doc """ breakpoint(*args, **kws)

Call sys.breakpointhook(*args, **kws).  sys.breakpointhook() must accept
whatever arguments are passed.

By default, this drops you into the pdb debugger.
"""
pass

def callable(i_e_, some_kind_of_function): # real signature unknown; restored from doc """ Return whether the object is callable (i.e., some kind of function).

Note that classes are callable, as are instances of classes with a
__call__() method.
"""
pass

```

目錄(無連結) 1 representation , vote , containing

2 escape

3 unreliable

4 binary

5 breakpoint

6 default

7 drops

8 debugger

9instances

1 representation [ 英 [,reprɪzen'teɪʃ(ə)n] 美 ['rɛprɪzɛn'teʃən] n. 代表;表現;表示法;陳述] {when you have someone to speak, vote(使投票,選票), or make decisions for you 代理,代表} <a string containing([kən'tenɪŋ] 包含,容納,剋制,contain) a printable representation of anobject???>

2 escape [ 英 [ɪ'skeɪp; e-] 美 [ɪˈskep] vt. 逃避,避開,避免;被忘掉;被忽視 vi. 逃脫;避開;溜走;(氣體,液體等)漏出;(未受傷或只受了一點傷害而)逃脫;聲音(不自覺地)由…發出 n. 逃跑;逃亡;逃走;逃跑工具或方法;野生種;洩漏] {to leave a place when someone is trying to catch you or stop you, or when there is a dangerous situation(情況)逃走,逃離} <escape the non-ASCII characters(字元) in the string 避開字串中的非ASCII字元,XXX除外 >

3 unreliable [英 [ʌnrɪ'laɪəb(ə)l] 美 [,ʌnrɪ'laɪəbl] adj. 不可靠的;靠不住的] {unable to be trusted(可信的) or depended on(依賴於,取決於)不可信賴的;不可靠的} <unreliably restored from doc >

4 binary [ 英 ['baɪnərɪ] 美 ['baɪnəri] adj. [數] 二進位制的;二元的,二態的] {the binary system a system of counting, used in computers, in which only the numbers 0 and 1 are used 〔計算機運算系統〕二進位制} <bin()把十進位制數轉成二進位制表示,hex(),oct()>

5 breakpoint [['breikpɔint] n. [計] 斷點,斷裂點] { an instruction([ɪn'strʌkʃən] n. 指令,命令;指示;教導;用法說明) inserted by a debug program causing a return to the debug program 斷點指令; 除錯程式中插入的指令,可使返回除錯程式} <基本沒用,用pycharm的debug除錯就OK>

6 default [ 英 [dɪ'fɔːlt; 'diːfɔːlt] 美 [dɪ'fɔlt] vi. 拖欠;不履行;不到場 n. 違約;缺席;缺乏;系統預設值 vt. 不履行;不參加(比賽等);對…處以缺席裁判] {by default if you win a game, competition etc by default, you win it because your opponent( [ə'ponənt]對手) did not play or because there were no other competitors(kəm'pɛtətɚ. 競爭者) 因對手棄權[缺席],因無其他參賽者〔而獲勝〕 if something happens by default, it happens because you did not do anything to change it 由於沒有采取行動} <by default 預設時……>

7 drops <=> drop [ 英 [drɒp] 美 [drɑp] vt. 滴;使降低;使終止;隨口漏出 vi. 下降;終止 n. 滴;落下;空投;微量;滴劑] {to stop holding(持有,擁有) or carrying something so that it falls 讓〔某物〕落下}

8 debugger [ 英 [diː'bʌgə] 美 [di:'bʌɡə] n. 偵錯程式;[計] 除錯程式] {Script Debugger 指令碼除錯程式 Script Debugger 指令碼偵錯程式 console debugger 控制檯蝶程式 Debugger Users 偵錯程式使用者 Remote Debugger 遠端偵錯程式 NetConnection Debugger 其還有除錯模組 POSTMORTEM DEBUGGER 如何設定驗屍除錯 debugger compilation 除錯程式編譯 Wake debugger 喚醒偵錯程式 portable debugger 可攜除錯器}

9instances <=> instance [ 英 ['ɪnst(ə)ns] 美 ['ɪnstəns] n. 例項;情況;建議 vt. 舉...為例] {an example of a particular kind of situation 〔特定情況的〕例子,例項} 物件obj>

函式理解 ascii() | repr() 和 eval(),前兩個是將物件轉成str--->‘[1,2]’|'5'| '{1:!}' , eval()反過來。

>>> ascii([1,2])
'[1, 2]'
>>> repr([1,2])
'[1, 2]'
>>> eval('1+1')
2

bin()是將十進位制轉成二進位制,oct()十轉8 , hex()十轉16

>>> bin(10)
'0b1010'
>>> oct(10)
'0o12'
>>> hex(10)
'0xa'

callable():檢視是不是可呼叫,喚醒。返回True說明可以加()呼叫

>>> callable(5)
False   #整數,浮點數不可被呼叫
>>> callable('5')
False   #字串不可被呼叫
>>> callable([5])
False   #列表不可被呼叫
>>> callable(print)
True   #函式(內建,自定義)可被呼叫
>>> callable(str)
True   #str這是類可以被呼叫(例項化)