Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • T transonic
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

April 05-07 - Mercurial Paris Conference 2023 - One day of workshop dedicated to Heptapod and Mercurial usage and workflow. There are still places available for both workshops and talks!

  • fluiddynfluiddyn
  • transonic
  • Issues
  • #6
Closed
Open
Issue created Mar 18, 2019 by Bitbucket Importer@bitbucket_importerMaintainer

Alternative syntax for blocks with decorator and context manager

Created originally on Bitbucket by paugier (Pierre Augier)

I'd like to support such things:

for functions:

from transonic import with_blocks, block

@with_blocks
def func(arg: int):
    a = non_pythranizable(arg)
    with block():
        a: float
        tmp = a + arg
    return non_pythranizable(tmp)

I think supporting return in a block is going to be difficult.

for classes:

from transonic import boost, with_blocks, block

@boost
class MyClass:
    attr0: int

    @with_blocks
    def func(self, arg: int):
        a = non_pythranizable(arg)
        with block():
            a: float
            tmp = a + arg + self.attr0
        return non_pythranizable(tmp)
  • We could also support block signatures # transonic block (int: a, b; A: c, d, e) in the block.
Edited Jun 13, 2020 by Pierre Augier
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking