KxSystems / pyq

PyQ — Python for kdb+
http://code.kx.com/q/interfaces
Apache License 2.0
191 stars 49 forks source link

q processing *.p file does not recognize decorators #111

Closed andersontigerzhang closed 4 years ago

andersontigerzhang commented 5 years ago

Questions

CentOS Linux release 7.4.1708 64bit

'4.1.4'

3.5 2017.03.28 64bit

- [ ] If on 64-bit, is your `QLIC` set? Please provide output `env | grep QLIC` on linux/macOS, or `set|grep QLIC` on Windows.

yes

no. I don't know why I should install virtual env.

QHOME=/dat/bcprod_constans/bin/kx/3.5

conda 4.6.9

Steps to reproduce the issue

Just use any script with decorators I don't know why this is not supported.

Expected result

Actual result

Workaround

If you know workaround, please provide it here.

andersontigerzhang commented 5 years ago

On a separate note, another enhancement is to allow pyq to run the compiled code. We can use cython --embed to convert to c file. after that I don't know how I can compile that to be used by pyq.

WillDaSilva commented 4 years ago

As a workaround, you can write out what the decorator is doing manually. It's far from ideal, but I haven't found any better solution.

Example:

def decorator(func):
    ''' Example decorator; does nothing '''
    return func

def f(x):
    return x
f = decorator(f) # manually apply decorator
github-actions[bot] commented 4 years ago

Stale issue message

cmccarthy1 commented 3 years ago

@abalkin I see you self assigned this issue, has there been any progress on this? There have been a number of users on internal channels asking about this