-
Notifications
You must be signed in to change notification settings - Fork 39
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
creating root construct in Python #1063
creating root construct in Python #1063
Comments
I'm not sure if there's a way to do this in non-TypeScript languages right now. @rittneje What kind of use case did you have in mind? I wonder if it might make some sense to allow creating root constructs natively somehow, or to cast things into an "any" type in JSII languages? cc @rix0rrr @RomainMuller |
@Chriscbr I don't have a particular use case per se, I was just trying to experiment with this library and immediately hit a wall. |
@rittneje I think this is an https://github.com/aws/jsii issue. Looking into the code of /**
* Initializes a CDK application.
* @param props initialization properties
*/
constructor(props: AppProps = {}) {
super(undefined as any, '', {
... Doing that "trick" you can still tell every user of the I think even if you could express this in Python, then jsii has to translate this expression back to TypeScript. IMHO you could close the issue here and suggest this functionality in the jssi repo. |
This would have been useful for testing. It might be useful to expose a root construct generator as part of this library. What do the maintainers think? |
A static helper to create a root construct should work. PRs are welcome! |
I installed constructs version 10.1.14 via pip. I am using Python 3.9.12 and NodeJS 16.15.0. I tried to create a root construct, but it throws an exception.
Is this a bug? Or is there some other way I'm supposed to create a root construct in Python?
The text was updated successfully, but these errors were encountered: