Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
10dca6e2
Commit
10dca6e2
authored
Mar 19, 2008
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The filter() function does support a None argument in Py3.0.
parent
05387861
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
27 deletions
+0
-27
Lib/test/test_py3kwarn.py
Lib/test/test_py3kwarn.py
+0
-11
Modules/itertoolsmodule.c
Modules/itertoolsmodule.c
+0
-9
Python/bltinmodule.c
Python/bltinmodule.c
+0
-7
No files found.
Lib/test/test_py3kwarn.py
View file @
10dca6e2
...
...
@@ -48,17 +48,6 @@ class TestPy3KWarnings(unittest.TestCase):
with
catch_warning
()
as
w
:
self
.
assertWarning
(
cell0
<
cell1
,
w
,
expected
)
def
test_filter
(
self
):
from
itertools
import
ifilter
from
future_builtins
import
filter
expected
=
'ifilter with None as a first argument is not supported '
\
'in 3.x. Use a list comprehension instead.'
with
catch_warning
()
as
w
:
self
.
assertWarning
(
ifilter
(
None
,
[]),
w
,
expected
)
with
catch_warning
()
as
w
:
self
.
assertWarning
(
filter
(
None
,
[]),
w
,
expected
)
def
test_code_inequality_comparisons
(
self
):
expected
=
'code inequality comparisons not supported in 3.x.'
def
f
(
x
):
...
...
Modules/itertoolsmodule.c
View file @
10dca6e2
...
...
@@ -2552,15 +2552,6 @@ ifilter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if
(
!
PyArg_UnpackTuple
(
args
,
"ifilter"
,
2
,
2
,
&
func
,
&
seq
))
return
NULL
;
if
(
func
==
Py_None
)
{
if
(
Py_Py3kWarningFlag
&&
PyErr_Warn
(
PyExc_DeprecationWarning
,
"ifilter with None as a first argument "
"is not supported in 3.x. Use a list "
"comprehension instead."
)
<
0
)
return
NULL
;
}
/* Get iterator. */
it
=
PyObject_GetIter
(
seq
);
if
(
it
==
NULL
)
...
...
Python/bltinmodule.c
View file @
10dca6e2
...
...
@@ -296,13 +296,6 @@ builtin_filter(PyObject *self, PyObject *args)
}
if
(
func
==
(
PyObject
*
)
&
PyBool_Type
||
func
==
Py_None
)
{
if
(
Py_Py3kWarningFlag
&&
PyErr_Warn
(
PyExc_DeprecationWarning
,
"filter with None as a first argument "
"is not supported in 3.x. Use a list "
"comprehension instead."
)
<
0
)
return
NULL
;
ok
=
PyObject_IsTrue
(
item
);
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment