Skip to content

Conversation

@saatviku
Copy link

@saatviku saatviku commented Mar 6, 2021

This minor change is intended to make library run error free in Python 3.

Python 3 dropped support for reduce() without using functools.

Reduce() is available in functools in Python2 as well.
https://docs.python.org/2/library/functools.html#functools.reduce

"This is the same function as reduce(). It is made available in this module to allow writing code more forward-compatible with Python 3."

Lack of this will throw an error in Python 3 : NameError: name 'reduce' is not defined

This minor change is intended to make library run error free in Python 3.

Python 3 dropped support for reduce() without using functools. 

Reduce() is available in functools in Python2 as well. 
https://docs.python.org/2/library/functools.html#functools.reduce 

"This is the same function as reduce(). It is made available in this module to allow writing code more forward-compatible with Python 3."
@parsifal-47
Copy link
Contributor

Thanks for contributing!
Hopefully someone with write access would merge it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants