Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a8b1f4f

Browse files
committed
PEP8 : more conversion of lambda to method
1 parent ef29b87 commit a8b1f4f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/matplotlib/backends/backend_pdf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,9 @@ def writeXref(self):
14521452
def writeInfoDict(self):
14531453
"""Write out the info dictionary, checking it for good form"""
14541454

1455-
is_date = lambda x: isinstance(x, datetime)
1455+
def is_date(x):
1456+
return isinstance(x, datetime)
1457+
14561458
check_trapped = (lambda x: isinstance(x, Name) and
14571459
x.name in ('True', 'False', 'Unknown'))
14581460
keywords = {'Title': is_string_like,

lib/matplotlib/tests/test_mlab.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2886,7 +2886,9 @@ def test_callable_covariance_dataset(self):
28862886
np.random.seed(8765678)
28872887
n_basesample = 50
28882888
multidim_data = [np.random.randn(n_basesample) for i in range(5)]
2889-
callable_fun = lambda x: 0.55
2889+
2890+
def callable_fun(x):
2891+
return 0.55
28902892
kde = mlab.GaussianKDE(multidim_data, bw_method=callable_fun)
28912893
assert_equal(kde.covariance_factor(), 0.55)
28922894

0 commit comments

Comments
 (0)