diff --git a/IPython/iplib.py b/IPython/iplib.py index ad717d2..df6af05 100644 --- a/IPython/iplib.py +++ b/IPython/iplib.py @@ -6,7 +6,7 @@ Requires Python 2.1 or newer. This file contains all the classes and helper functions specific to IPython. -$Id: iplib.py 975 2005-12-29 23:50:22Z fperez $ +$Id: iplib.py 976 2005-12-30 01:02:09Z fperez $ """ #***************************************************************************** @@ -1744,7 +1744,21 @@ want to merge them back into the new files.""" % locals() return self.handle_normal(line,continue_prompt) if oinfo is None: - oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic + # let's try to ensure that _oinfo is ONLY called when autocall is + # on. Since it has inevitable potential side effects, at least + # having autocall off should be a guarantee to the user that no + # weird things will happen. + + if self.rc.autocall: + oinfo = self._ofind(iFun) # FIXME - _ofind is part of Magic + else: + # in this case, all that's left is either an alias or + # processing the line normally. + if iFun in self.alias_table: + return self.handle_alias(line,continue_prompt, + pre,iFun,theRest) + else: + return self.handle_normal(line,continue_prompt) if not oinfo['found']: return self.handle_normal(line,continue_prompt) diff --git a/doc/ChangeLog b/doc/ChangeLog index 8eab3a8..08c7d5c 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -3,6 +3,12 @@ * IPython/iplib.py (showtraceback): remove use of the sys.last_{type/value/traceback} structures, which are non thread-safe. + (_prefilter): change control flow to ensure that we NEVER + introspect objects when autocall is off. This will guarantee that + having an input line of the form 'x.y', where access to attribute + 'y' has side effects, doesn't trigger the side effect TWICE. It + is important to note that, with autocall on, these side effects + can still happen. * IPython/macro.py (Macro.__init__): moved macros to a standalone file. Now that they'll be more likely to be used with the