A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-May/024801.html below:

[Python-Dev] Re: String module

[Python-Dev] Re: String module [Python-Dev] Re: String moduleBarry A. Warsaw barry@zope.com
Fri, 31 May 2002 11:36:59 -0400
>>>>> "FP" =3D=3D Fran=E7ois Pinard <pinard@iro.umontreal.ca> writes:

    >> By the way, I wonder why the `_' in `sys._getframe()'.

    >> To discourage people from using it.

    FP> Why was it introduced then, since there was already a way
    FP> without it?  Execution speed, maybe?

Because

    try:
        1/0
    except ZeroDivisionError:
        return sys.exc_info()[2].tb_frame.f_back

is slow, hard to remember, and too magical.  Also, sys._getframe()
gives you a better interface for getting frames farther back than
currentframe().

-Barry




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4