File: list.py

package info (click to toggle)
python-deepmerge 0.0.5-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 188 kB
  • sloc: python: 370; makefile: 195
file content (24 lines) | stat: -rw-r--r-- 540 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from .core import StrategyList


class ListStrategies(StrategyList):
    """
    Contains the strategies provided for lists.
    """

    NAME = "list"

    @staticmethod
    def strategy_override(config, path, base, nxt):
        """ use the list nxt. """
        return nxt

    @staticmethod
    def strategy_prepend(config, path, base, nxt):
        """ prepend nxt to base. """
        return nxt + base

    @staticmethod
    def strategy_append(config, path, base, nxt):
        """ append nxt to base. """
        return base + nxt