-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Milestone
Description
See https://github.com/GoogleCloudPlatform/gcloud-python/pull/770/files#r27422508
return self
is a JavaScript-y method chaining construct.
In Python
foo = Foo()
foo2 = foo.update()
indicates that foo2
is indeed a Foo
object, but that foo.update()
has applied the changes without mutating foo
. Using return self
breaks that expectation.
For example on list
>>> a = [3, -4, 1, 0]
>>> b = a.sort()
>>> b is None
True
>>> a
[-4, 0, 1, 3]
Metadata
Metadata
Assignees
Labels
No labels