Skip to content

Commit

Permalink
private functions should start with _
Browse files Browse the repository at this point in the history
  • Loading branch information
saulpw authored Sep 2, 2023
1 parent fe29f0e commit 40451f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions visidata/aggregators.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __call__(self, *args, **kwargs):
@VisiData.api
def aggregator(vd, name, funcValues, helpstr='', *args, type=None):
'Define simple aggregator *name* that calls ``funcValues(values, *args)`` to aggregate *values*. Use *type* to force the default type of the aggregated column.'
def funcRows(col, rows): # wrap builtins so they can have a .type
def _funcRows(col, rows): # wrap builtins so they can have a .type
vals = list(col.getValues(rows))
try:
return funcValues(vals, *args)
Expand All @@ -81,7 +81,7 @@ def funcRows(col, rows): # wrap builtins so they can have a .type
return None
return e

vd.aggregators[name] = _defaggr(name, type, funcRows, funcValues=funcValues, helpstr=helpstr) # accepts a srccol + list of rows
vd.aggregators[name] = _defaggr(name, type, _funcRows, funcValues=funcValues, helpstr=helpstr) # accepts a srccol + list of rows

## specific aggregator implementations

Expand Down

0 comments on commit 40451f4

Please sign in to comment.