4 ms·
While the comments about being pythonic are valid, I think this looks fantastic and I'll take it for a spin around the block. Are you using this in your product
by harel 9y ago
While the comments about being pythonic are valid, I think this looks fantastic and I'll take it for a spin around the block. Are you using this in your production environment already?
In regards to the 'name' being a function - a class attribute might indeed be more correct but a function allows for dynamic computation names where its applicable.
- masklinn 9y ago> In regards to the 'name' being a function - a class attribute might indeed be more correct but a function allows for dynamic computation names where its applicable. https://docs.python.org/3/library/functions.html#property https://docs.python.org/3/library/functions.html#property Accessing a simple attribute on the instance means it can be defined as any of a class attribute (instance will delegate to class), an instance attribute (computed/set in init) or a property (computed every time it's accessed), which is convenient, especially when the primary use case will be setting the name on the class directly. In fact you could even fallback on the class name.
- spooneybarger 9y agoThank you harel for you kind comment. We aren't using it in our production environment as we don't have one. We are the builders of Wallaroo. We've done a number of POCs with various clients and are moving towards production deployments with them. Re the API: if you want to take part in helping shape the next version of the API, please reach out to me personally (via the email address in my HN profile) or via: * #wallaroo on freenode * our user mailing list: https://groups.io/g/wallaroo https://groups.io/g/wallaroo We did the initial version of the API based on feedback from a couple clients we were working with. We're actively looking for feedback from a larger group of folks as we move forward.
- RHSman2 9y agoIf you did POC's did it turn into Prod? If not why not? Do people use it in prod is what I think is meant.
- spooneybarger 9y agoNot yet but it's looking like the first couple will happen in Q1 or Q2 next year. Why not really depends per location. None have been because we didn't pass the POC. Most so far have been that it works well and now it's a matter of slotting into the roadmap at those companies.
- iterati 9y agoSo use @property then?
- pryelluw 9y ago__SOME_VAR = "foo" @property def some_var(self): return self.__SOME_VAR ?
- TremendousJudge 9y agoYes, just like that. Check out this fantastic talk on being pythonic: https://www.youtube.com/watch?v=wf-BqAjZb8M https://www.youtube.com/watch?v=wf-BqAjZb8M
- harel 9y agoIndeed.