Skip to content

Commit c0364c3

Browse files
committed
remove IDOM_FEATURE_INDEX_AS_DEFAULT_KEY opt
1 parent cc9518d commit c0364c3

File tree

3 files changed

+5
-34
lines changed

3 files changed

+5
-34
lines changed

docs/source/about/changelog.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ more info, see the :ref:`Contributor Guide <Creating a Changelog Entry>`.
2323
Unreleased
2424
----------
2525

26-
No changes.
26+
**Removed**
27+
28+
- :pull:`840` - remove ``IDOM_FEATURE_INDEX_AS_DEFAULT_KEY`` option
2729

2830

2931
v0.41.0

src/idom/config.py

-16
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,6 @@
6262
)
6363
"""This has been renamed to :data:`IDOM_WEB_MODULES_DIR`"""
6464

65-
IDOM_FEATURE_INDEX_AS_DEFAULT_KEY = _Option(
66-
"IDOM_FEATURE_INDEX_AS_DEFAULT_KEY",
67-
default=True,
68-
mutable=False,
69-
validator=lambda x: bool(int(x)),
70-
)
71-
"""Use the index of elements/components amongst their siblings as the default key.
72-
73-
The flag's default value is set to true. To return to legacy behavior set
74-
``IDOM_FEATURE_INDEX_AS_DEFAULT_KEY=0``. In a future release, this flag will be removed
75-
entirely and the indices will always be the default key.
76-
77-
For more information on changes to this feature flag see:
78-
https://github.com/idom-team/idom/issues/351
79-
"""
80-
8165
IDOM_TESTING_DEFAULT_TIMEOUT = _Option(
8266
"IDOM_TESTING_DEFAULT_TIMEOUT",
8367
5.0,

src/idom/core/layout.py

+2-17
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@
2424
from uuid import uuid4
2525
from weakref import ref as weakref
2626

27-
from idom.config import (
28-
IDOM_CHECK_VDOM_SPEC,
29-
IDOM_DEBUG_MODE,
30-
IDOM_FEATURE_INDEX_AS_DEFAULT_KEY,
31-
)
27+
from idom.config import IDOM_CHECK_VDOM_SPEC, IDOM_DEBUG_MODE
3228
from idom.utils import Ref
3329

3430
from ._event_proxy import _wrap_in_warning_event_proxies
@@ -755,7 +751,7 @@ def _process_child_type_and_key(
755751
key = None
756752

757753
if key is None:
758-
key = _default_key(index)
754+
key = index
759755

760756
yield (child, child_type, key)
761757

@@ -765,14 +761,3 @@ def _process_child_type_and_key(
765761
_DICT_TYPE = _ElementType(1)
766762
_COMPONENT_TYPE = _ElementType(2)
767763
_STRING_TYPE = _ElementType(3)
768-
769-
770-
if IDOM_FEATURE_INDEX_AS_DEFAULT_KEY.current:
771-
772-
def _default_key(index: int) -> Any:
773-
return index
774-
775-
else:
776-
777-
def _default_key(index: int) -> Any: # pragma: no cover
778-
return object()

0 commit comments

Comments
 (0)