Lo-Dash Differences¶
Naming Conventions¶
pydash adheres to the following conventions:
- Function names use
snake_case
instead ofcamelCase
. - Any Lo-Dash function that shares its name with a reserved Python keyword will have an
_
appended after it (e.g.filter
in Lo-Dash would befilter_
in pydash. - Lo-Dash’s
toArray()
is pydash’sto_list()
. - Lo-Dash’s
functions()
is pydash’scallables()
. This particular name difference was chosen in order to allow for thefunctions.py
module file to exist at root of the project. Previously,functions.py
existed inpydash/api/
but inv2.0.0
, it was decided to move everything inapi/
topydash/
. Therefore, In to avoid import ambiguities, thefunctions()
function was renamed.
Callbacks¶
There are a few differences between extra callback style support:
- Lo-Dash’s property style callback form uses shallow property access while the same form in pydash uses deep property access via the deep path string.
- Pydash has an explicit shallow property access of the form
['some_property']
.
Extra Functions¶
In addition to porting Lo-Dash, pydash contains functions found in lodashcontrib, lodashdeep, lodashmath, and underscorestring.
Function Behavior¶
Some of pydash’s functions behave differently:
pydash.utilities.memoize()
uses all passed in arguments as the cache key by default instead of only using the first argument.
Templating¶
- pydash doesn’t have
template()
. See Templating for more details.