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/2003-February/033720.html below:

[Python-Dev] Code Generation Idea Was: Bytecode idea

[Python-Dev] Code Generation Idea Was: Bytecode idea [Python-Dev] Code Generation Idea Was: Bytecode ideaGuido van Rossum guido@python.org
Wed, 26 Feb 2003 11:14:35 -0500
> Would it be simpler to institute a special rule that True = 1 is silently
> ignored, but True = anything else generates an error message?  Or am I
> overlooking something important?

Some people prefer

  True = (1 > 0)

because this accesses the special integer (with value 1) that is used
by the interpreter for the outcome of boolean results .

> If you want to handle assigning to True an expression whose value is
> known only at run time, translate it into
> 
>    if expression != 1 :
>       raise Exception, "Attempt to assign invalid value to True"
> 
> which would give a run-time error without costing cycles anywhere else.

I suggest you try coming up with a patch for that to see how much work
it is.  I expect it to be tough.

--Guido van Rossum (home page: http://www.python.org/~guido/)



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