• Quentin Defenouillere's avatar
    weboob.browser.filters: Handle values with empty() for numeric values · d29d1909
    Quentin Defenouillere authored
    Example:
    
    ```python
    amount = Coalesce(
        CleanDecimal.US('//xpath', default=NotAbailable),
        CleanDecimal.US('//xpath2', default=NotAvailable),
    )(self.doc)
    ```
    
    If one of the CleanDecimal returns NotAvailable and the other '0.00', with
    the current behavior, Coalesce will crash with "All falsy and no default"
    because we use "if value" in the loop of the filter.
    
    With empty(value), Coalesce accepts 0.00 as a valid value for numeric
    elements.
    d29d1909
Name
Last commit
Last update
.ci Loading commit data...
.gitlab/issue_templates Loading commit data...
contrib Loading commit data...
desktop Loading commit data...
docs Loading commit data...
icons Loading commit data...
man Loading commit data...
modules Loading commit data...
tools Loading commit data...
weboob Loading commit data...
.editorconfig Loading commit data...
.gitignore Loading commit data...
.gitlab-ci.yml Loading commit data...
.mailmap Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING Loading commit data...
COPYING.LESSER Loading commit data...
ChangeLog Loading commit data...
INSTALL Loading commit data...
MANIFEST.in Loading commit data...
MANIFEST.in.modules Loading commit data...
README.md Loading commit data...
build.mk Loading commit data...
setup.cfg Loading commit data...
setup.py Loading commit data...