Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Explicitly import reduce from functools#8

Open
saatviku wants to merge 1 commit into
machinezone:mastermachinezone/python_etf:masterfrom
saatviku:patch-1saatviku/python_etf:patch-1Copy head branch name to clipboard
Open

Explicitly import reduce from functools#8
saatviku wants to merge 1 commit into
machinezone:mastermachinezone/python_etf:masterfrom
saatviku:patch-1saatviku/python_etf:patch-1Copy head branch name to clipboard

Conversation

@saatviku

@saatviku saatviku commented Mar 6, 2021

Copy link
Copy Markdown

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
Copy Markdown
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.