Generated objects in python have unreal names - th...
# python
Generated objects in python have unreal names - this is not pythonic it looks like Java or C# at best 😞
Copy code
Is there any chance to remedy this? without dropping into dictionaries? PEP8 python line length suggest 79 characters the name above is 57!
What’s your suggestion?
first at least drop the suffix
if possible because it's not consistent with docs Then make use of namespaces as Zen of python says - I wonder how it would look if we could break it down into packages
Copy code
import this
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Let's say: I have
Found another one with 84! 😄 ServiceSourceConfigurationCodeRepositoryCodeConfigurationCodeConfigurationValuesArgs
💥 1
FWIW, you don’t need to use the
classes. They are provided as a convenience and an alternative to using keyword args. We added them recently as a user request so that args could be passed around separately from the resources. That being said, this is not about python but how the resources are structured in the encapsulating providers. Anyway, welcome to our world… let us know if you figure out how to do it in a way that you find more appealing and we’ll consider it 🙂
I took a lot of inspiration from CDK to me it seems they are on the right track
Instead of this
Copy code
            "connection_arn": aws_apprunner_connection["example"]["arn"],
I'd rather
Copy code
In case this would be a conflict then use namespace -> sub-package
then user has choice whether to use full name from the parent or import as deeply as needed eg.
Copy code
from pulumi_aws.apprunner.service import AuthenticationConfiguration
I’d rather
Copy code
This is how it currently works.
no, current Class name is
it should be at least 2 or 3 nested packages in order to prevent namespace conflicts. not just concacetnating names
On top of that word
repeats in the name twice. In this class even three times!
Copy code
names like this does not make anything easier to read, it's the exact opposite
It’s unlikely that we will take a massive breaking change like this, but you are welcome to open an issue and summarize your suggestion