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

complex type self referencing (for complex tree) #36

Open
jblamotte opened this issue Nov 22, 2013 · 2 comments
Open

complex type self referencing (for complex tree) #36

jblamotte opened this issue Nov 22, 2013 · 2 comments

Comments

@jblamotte
Copy link

add support for complex type self referencing.
For exemple :

def getElement():
return Element

Element = {
0: 'Element',
'children': [getElement]
}

Must support dict from function ptr.

jblamotte pushed a commit to jblamotte/pyws that referenced this issue Nov 22, 2013
Add support for complex type self referencing
@jblamotte jblamotte mentioned this issue Nov 22, 2013
@stepank
Copy link
Owner

stepank commented Nov 22, 2013

It is already possible: https://github.com/stepank/pyws/blob/develop/examples/functions.py#L107 . Your particular example can be done like this:

Element = DictOf('Element')
Element.add_fields('children', [Element])

Is that what you want?

@jblamotte
Copy link
Author

Oops 👍
That's exactly what i wanted. My mistake :)

Nevertheless, i sent you a pull request to support an alternative way to do that. (providing a function pointer returning a dict). Can be usefull .. or not. (:p)

I also added long support. I could add some other primitive in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants