Skip to content

Systematic fails due to collections.Iterable deprecation #14

@rgeronimi

Description

@rgeronimi

The following call now fails systematically with Python 3.10:

ballpark.business(123)

with the error:

File /usr/local/Caskroom/miniconda/base/envs/myenv/lib/python3.10/site-packages/ballpark/utils.py:85, in unwrap.<locals>.unwrapped_function(values, *vargs, **kwargs)
     83 @functools.wraps(fn)
     84 def unwrapped_function(values, *vargs, **kwargs):
---> 85     scalar = not isinstance(values, collections.Iterable)
     87     if scalar:
     88         values = [values]

AttributeError: module 'collections' has no attribute 'Iterable'

This may impact several or all other ballpark functions (I didn't test the other ones).

This is due to Python 3.10 (or earlier, I don't know) deprecating collections.Iterable in favor of collections.abc.Iterable.

The fix is to update this accordingly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions