-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
pubsub.Topic.create() returns None? #837
Comments
We've spoken a bit about this. That is un-Pythonic. For example, see from the standard library. >>> a = [1, -1, 10, 6]
>>> b = a.sort()
>>> b is None
True
>>> a
[-1, 1, 6, 10] |
Being able to chain things nicely is un-Pythonic? Do we have more references to why this is a bad idea? Can you point me to that discussion? It looks like Boto does this... See: |
Having been inside, |
That doesn't really answer things for me ... :( I think the bigger issue is that I don't see a use for a Would this method be better as a factory? topic = pubsub.Topic.create('topic-name') or topic = pubsub.create_topic('topic-name') ? |
So they have the option of "functional" approach |
Does that exist? I don't see it...
Totally agree - I don't want to hide that a request is being made. Wouldn't the two options go against the whole "one way to do things" idea? |
Indeed they would violate the Zen of Python "There should be one-- and preferably only one --obvious way to do it.". @tseaver has mentioned abolishing functions of the form top_level_package.verb_thing(args) in favor of thing = top_level_package.Thing(...)
thing.verb(args) |
What's the reason for that ? If we're going to go that way, I'd like to re-open the topic of enforcing all our methods to be chainable. I'd rather go the |
Closing this as #911 due to lost steam |
I'd really like to write
Looks like from the code we have today, that we don't return anything, so this won't work (topic will be
None
right here).The text was updated successfully, but these errors were encountered: