Skip to content

Commit

Permalink
move no cover to dynamic key default
Browse files Browse the repository at this point in the history
also update IDOM_FEATURE_INDEX_AS_DEFAULT_KEY docstring
  • Loading branch information
rmorshea committed Jan 11, 2022
1 parent 2c26b51 commit 760c479
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/idom/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@
)
"""Use the index of elements/components amongst their siblings as the default key.
In a future release this flag's default value will be set to true, and after that, this
flag will be removed entirely and the indices will always be the default key.
The flag's default value is set to true. To return to legacy behavior set
``IDOM_FEATURE_INDEX_AS_DEFAULT_KEY=0``. In a future release, this flag will be removed
entirely and the indices will always be the default key.
For more information on changes to this feature flag see: https://github.com/idom-team/idom/issues/351
For more information on changes to this feature flag see:
https://github.com/idom-team/idom/issues/351
"""
4 changes: 2 additions & 2 deletions src/idom/core/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,10 +698,10 @@ def _process_child_type_and_key(

if IDOM_FEATURE_INDEX_AS_DEFAULT_KEY.current:

def _default_key(index: int) -> Any: # pragma: no cover
def _default_key(index: int) -> Any:
return index

else:

def _default_key(index: int) -> Any:
def _default_key(index: int) -> Any: # pragma: no cover
return object()

0 comments on commit 760c479

Please sign in to comment.