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/2004-June/045201.html below:

[Python-Dev] Dropping decorator syntax for 2.4?

[Python-Dev] Dropping decorator syntax for 2.4? [Python-Dev] Dropping decorator syntax for 2.4?Thomas Heller theller at python.net
Fri Jun 4 05:59:46 EDT 2004
Couldn't Guido's syntax be implemented as a combination of an import
hook together with a byte code hack, without direct support in the core?

Code like this

  [decorator1, decorator2]
  def func(args):
      pass

seems to be compiled into these byte codes
             ....
           6 BUILD_LIST               
           9 POP_TOP             
          10 LOAD_CONST               0 (<code object test at 0091FD20, ...)
          13 MAKE_FUNCTION            0
          16 STORE_NAME               2 (test)

It seems BUILD_LIST / POP_TOP / LOAD_CONST / MAKE_FUNCTION is the
sequence which should trigger the magic.

Thomas


More information about the Python-Dev mailing list

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