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-April/014209.html below:

[Python-Dev] Complex detection

[Python-Dev] Complex detection [Python-Dev] Complex detectionTim Peters tim.one@home.com
Fri, 13 Apr 2001 18:48:22 -0400
[Paul F. Dubois]
> My understanding is that Python can be built without complex numbers
> to satisfy the needs of the Python-on-a-wristwatch crowd. Is there a
> run-time way to tell? For example, using an imaginary literal causes
> an error? If so, what kind?

You can find out by compiling with WITHOUT_COMPLEX #define'd.  PythonLabs
never does this, so no guarantee it even works.  I'm not going to bother
starting now, either <wink>.  Based on skimming the code, I expect

try:
    eval("1j")
    with_complex = 1
except SyntaxError:
    with_complex = 0

would do the trick, but no guarantee.




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