sync with O'Reilly Atlas
This commit is contained in:
@@ -59,7 +59,8 @@ Creating new attributes at runtime is restricted as well::
|
||||
...
|
||||
AttributeError: 'Movie' has no attribute 'director'
|
||||
|
||||
The `_as_dict` instance creates a `dict` from the attributes of a `Movie` object::
|
||||
The `_asdict` instance method creates a `dict` from the attributes
|
||||
of a `Movie` object::
|
||||
|
||||
>>> movie._asdict()
|
||||
{'title': 'The Godfather', 'year': 1972, 'box_office': 137.0}
|
||||
|
||||
@@ -58,7 +58,8 @@ Creating new attributes at runtime is restricted as well::
|
||||
...
|
||||
AttributeError: 'Movie' object has no attribute 'director'
|
||||
|
||||
The `_as_dict` instance creates a `dict` from the attributes of a `Movie` object::
|
||||
The `_asdict` instance method creates a `dict` from the attributes
|
||||
of a `Movie` object::
|
||||
|
||||
>>> movie._asdict()
|
||||
{'title': 'The Godfather', 'year': 1972, 'box_office': 137.0}
|
||||
|
||||
@@ -58,7 +58,8 @@ Creating new attributes at runtime is restricted as well::
|
||||
...
|
||||
AttributeError: 'Movie' object has no attribute 'director'
|
||||
|
||||
The `_as_dict` instance creates a `dict` from the attributes of a `Movie` object::
|
||||
The `_asdict` instance method creates a `dict` from the attributes
|
||||
of a `Movie` object::
|
||||
|
||||
>>> movie._asdict()
|
||||
{'title': 'The Godfather', 'year': 1972, 'box_office': 137.0}
|
||||
|
||||
Reference in New Issue
Block a user