-
Notifications
You must be signed in to change notification settings - Fork 4
Add warning for build-in function map #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: migration
Are you sure you want to change the base?
Conversation
warn user about returning map obj in 3.x
.mypy_cache/ | ||
.pytest_cache/ | ||
.DS_Store | ||
.history/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
Lib/test/test_builtin.py
Outdated
with warnings.catch_warnings(record=True) as w: | ||
warnings.simplefilter("always") | ||
list(map(lambda x: x, [1, 2, 3])) | ||
self.assertTrue(any("returns map object in 3.x" in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This message doesn't match what is in the warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to test_2x_warnings file and use with check_py2x_warnings() as w:
because again the -2 flag has to be used for these warnings to be triggered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nanjekyejoannah fixed and moved, thanks for pointing out!
Modified map_vectorcall in bltinmodule.c, which warn user about behavior change of map in 3.x (return map object)

Add a test case in test_builtin.py