不可变类型比如整形、浮点数和字符串都是散列的;
Immutable types like integers, floats and strings are hashable;
一个类型的复杂性指示了你应该使用这三个策略里面的哪一个来初始化不可变类型。
The complexity of a type dictates which of three strategies you will use to initialize your immutable type.
这些类型是不可变的,就是说整数对象一旦创建,其值便不可更改。
These types are immutable, which means that when an integer object is created, its value cannot be changed.
如文中所述,tuple类型是不可变的异构容器。
As discussed, the tuple type is an immutable heterogeneous container.
本系列的第三篇文章探索Python类型的层次结构 —— 使用字符串介绍了 Python string,这也是一个不可变的序列,但仅针对字符数据。
The third article in this series, " Exploring the Python type hierarchy, Introducing Strings," introduces the Python string, which is also an immutable sequence, but only for character data.
最后的建议是关于保护敏感数据的,就是要避免使用不可变的数据类型,比如string。
The last advice on protecting sensitive data is to avoid using immutable data types like String.
而VB却同时支持可变和不可变的匿名类型,对于这两种匿名类型,实现和使用的规则也略有不同。
VB allows both mutable and immutable anonymous types, with subtly different rules for each.
一种常用的列表类型是tuple,它是不可变的。
One common type of list is called a tuple, and as noted, it's immutable.
容器类型间的另一个不同点来自于它们所持有的数据的特性,下面四种容器类型的顺序是不可变的。
Another difference between the container types results from the nature of the data they hold. The following four container types are immutable sequences.
PublicServiceReminder:让一个对象的所有字段都为final并不一定使得这个对象不可变 —— 所有的字段还必须是原语类型或是对不可变对象的引用。
Public Service Reminder: Making all fields of an object final does not necessarily make the object immutable -- all fields must also be primitive types or references to immutable objects.
例如,tuple类型,尽管它是不可变的,灵活性较差,但在同一环境中使用时,它们通常比list类型快得多。
For example, the tuple type, while less flexible because it's immutable, is generally much faster than the list type when used in identical situations.
所有字面值都属于不可变的数据类型,因此对象的标识比起它们的值来说显得次要一些。
All literals correspond to immutable data types, and hence the object's identity is less important than its value.
集合有两种不同的类型,可变和不可变集合。
There are two different types of sets available, mutable and immutable.
不像字符串是不可变量,列表是可变类型,例如:它可以改变它本身某个元素的值。
Unlike strings, which are immutable, lists are a mutable type, i. e. it is possible to change their content.
为了创建一个不可变的类型,你需要保障没有任何漏洞允许客户修改你的内部状态。
To create an immutable type, you need to ensure that there are no holes that would allow clients to change your internal state.
不可变单向链接列表的类型的缩写词。
An abbreviation for the type of immutable singly-linked lists.
不可变单向链接列表的类型的缩写词。
An abbreviation for the type of immutable singly-linked lists.
应用推荐