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/2001-February/013192.html below:

Other situations like this (was RE: [Python-Dev] Nested scopes resolution -- you can breathe again!)

Other situations like this (was RE: [Python-Dev] Nested scopes resolution -- you can breathe again!) Other situations like this (was RE: [Python-Dev] Nested scopes resolution -- you can breathe again!)Tim Peters tim.one@home.com
Sat, 24 Feb 2001 02:54:40 -0500
[Tim]
> ...
> A compile-time exception:  when you're asking for semantics the compiler
> can't give you, the presumption has to favor that you're in big trouble.
> You can't catch such an exception directly in the same module (because it
> occurs at compile time), but can catch it if you import the module from
> elsewhere.

Relatedly, you could do:

    try:
        compile("from __future__ import whatever", "", "exec")
    except whatever2:
        whatever3
    else:
        whatever4

Then the future_stmt's compile-time is your module's runtime.

still-looks-pretty-useless-to-me-though-ly y'rs  - tim




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