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

Skip to content

Commit 78e59fd

Browse files
committed
implemented the consensus of restoring the Python builtin min(), max(),
round(), abs(), and sum() functions after a "from pylab import *". - ADS svn path=/trunk/matplotlib/; revision=876
1 parent d9ee67d commit 78e59fd

3 files changed

Lines changed: 21 additions & 0 deletions

File tree

API_CHANGES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1+
API CHANGES in matplotlib-0.70.2
2+
3+
builtin min(), max(), round(), abs(), sum() functions no longer
4+
overridden upon "from pylab import *"
5+
16
API CHANGES in matplotlib-0.70
27

38
MplEvent factored into a base class Event and derived classes
49
MouseEvent and KeyEvent
510

611
Removed definct set_measurement in wx toolbar
12+
713
API CHANGES in matplotlib-0.65.1
814

915
removed add_axes and add_subplot from backend_bases. Use

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
New entries should be added at the top
22

3+
2005-01-19 Restored builtin names which were overridden (min, max,
4+
abs, round, and sum) in pylab. This is a potentially significant
5+
change for those who were relying on an array version of those
6+
functions that previously overrode builtin function names. - ADS
7+
38
2005-01-18 Added accents to mathtext: \hat, \breve, \grave, \bar,
49
\acute, \tilde, \vec, \dot, \ddot. All of them have the same
510
syntax, eg to make an overbar you do \bar{o} or to make an o umlaut

lib/matplotlib/pylab.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,16 @@
216216

217217
import matplotlib
218218

219+
# Restore builtins which may have been overridden (typically by mlab).
220+
# This was discussed here
221+
# http://sourceforge.net/mailarchive/forum.php?thread_id=6307396&forum_id=33405
222+
import __builtin__
223+
min = __builtin__.min
224+
max = __builtin__.max
225+
sum = __builtin__.sum
226+
round = __builtin__.round
227+
abs = __builtin__.abs
228+
219229
def colors():
220230
"""
221231
This is a do nothing function to provide you with help on how

0 commit comments

Comments
 (0)