File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ Consider the following type definition:
5757
5858``` python
5959>> > from dataclasses import dataclass
60- >> > from itemadapter import ItemAdapter, is_item
60+ >> > from itemadapter import ItemAdapter
6161>> > @ dataclass
6262... class InventoryItem :
6363... name: str
@@ -70,7 +70,7 @@ An `ItemAdapter` object can be treated much like a dictionary:
7070
7171``` python
7272>> > obj = InventoryItem(name = ' foo' , price = 20.5 , stock = 10 )
73- >> > is_item(obj)
73+ >> > ItemAdapter. is_item(obj)
7474True
7575>> > adapter = ItemAdapter(obj)
7676>> > len (adapter)
@@ -218,7 +218,8 @@ calling `dict(adapter)`, because it's applied recursively to nested items (if th
218218### function ` itemadapter.utils.is_item(obj: Any) -> bool `
219219
220220Return ` True ` if the given object belongs to (at least) one of the supported types,
221- ` False ` otherwise. This is an alias for ` itemadapter.adapter.ItemAdapter.is_item ` .
221+ ` False ` otherwise. This is an alias, using the ` itemadapter.adapter.ItemAdapter.is_item `
222+ class method is encouraged for better performance.
222223
223224
224225### function ` itemadapter.utils.get_field_meta_from_class(item_class: type, field_name: str) -> types.MappingProxyType `
You can’t perform that action at this time.
0 commit comments