Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How could we get namespace values from thriftpy2.parser #294

Open
truebit opened this issue Sep 19, 2024 · 0 comments
Open

How could we get namespace values from thriftpy2.parser #294

truebit opened this issue Sep 19, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@truebit
Copy link
Contributor

truebit commented Sep 19, 2024

I saw two methods in parser.py concerning namespace:

def p_namespace(p):
    '''namespace : NAMESPACE namespace_scope IDENTIFIER'''
    # namespace is useless in thriftpy2
    # if p[2] == 'py' or p[2] == '*':
    #     setattr(thrift_stack[-1], '__name__', p[3])


def p_namespace_scope(p):
    '''namespace_scope : '*'
                       | IDENTIFIER'''
    p[0] = p[1]

But I cannot find namespace attributes after parsing the IDL file using from thriftpy2.parser.parser import parse.

Sometimes we need the namespace to locate the same method from different IDL。

@aisk aisk added the enhancement New feature or request label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants