python_一切皆對象


From Wikipedia

這里就解釋了deepcopy和copy的區別, eg, deepcopy把list里面的對象復制再放入新建立的list對象當中, 但是copy只是copy list的對象, list的內容還是原來list的reference type
Language Value type Reference type
C++[3] booleans, characters, integer numbers, floating-point numbers, arrays, classes (including strings, lists, dictionaries, sets, stacks, queues), enumerations alias, pointers
Java[4] booleans, characters, integer numbers, floating-point numbers arrays, classes (including immutable strings, lists, dictionaries, sets, stacks, queues, enumerations), interfaces, null pointer
C#[5] structures (including booleans, characters, integer numbers, floating-point numbers, fixed-point numbers, lists, dictionaries, sets, stacks, queues, optionals), enumerations classes (including immutable strings, arrays, tuples, lists, dictionaries, sets, stacks, queues), interfaces, pointers
Swift[6][7] structures (including booleans, characters, integer numbers, floating-point numbers, fixed-point numbers, immutable strings, tuples, lists, dictionaries, sets, stacks, queues), enumerations (including optionals) functions, classes, interfaces
Python[8] classes (including immutable booleans, immutable integer numbers, immutable floating-point numbers, immutable complex numbers, immutable strings, byte strings, immutable byte strings, immutable tuples, immutable ranges, immutable memory views, lists, dictionaries, sets, immutable sets, null pointer)
JavaScript[9] immutable booleans, immutable floating-point numbers, immutable symbols, immutable strings, undefined, prototypes (including lists, null pointer)
OCaml[10][11] immutable characters, immutable integer numbers, immutable floating-point numbers, immutable tuples, immutable enumerations (including immutable units, immutable booleans, immutable lists, immutable optionals), immutable exceptions, immutable formatting strings arrays, immutable strings, byte strings, dictionaries (including pointers)

注意!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。



python一切皆對象的理解 Python一切皆對象 Python一切皆對象 python中的一切皆對象 python中一切皆對象 Python-一切皆對象 python 一切皆對象 一、python中的一切皆對象 python_類型和對象 Python學習3-一切皆對象
 
粤ICP备14056181号  © 2014-2021 ITdaan.com