GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Clean up methods which return self · Issue #776 · googleapis/google-cloud-python

Clean up methods which return self #776

New issue
Copy link
New issue
Copy link
Closed
#783
Closed
Clean up methods which return self#776
#783
Copy link
Assignees
dhermes
Milestone
Storage Future

Description

@dhermes
dhermes
opened on Mar 30, 2015
Issue body actions

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]

Activity

  1. dhermes
    added
    hygiene
    on Mar 31, 2015
  2. dhermes
    self-assigned this
    on Mar 31, 2015
  3. dhermes
    added this to the Storage Future milestone on Mar 31, 2015
  4. dhermes
    added a commit that references this issue on Mar 31, 2015

    Remove uses of 'return self' that don't return copies.

    This issue will close once commit 04ada73 is merged into the 'master' branch.
    04ada73
  5. dhermes
    closed this as completedin #783on Mar 31, 2015
  6. parthea
    added a commit that references this issue on Oct 21, 2023

    move monitoring samples from python-docs-samples (#51)

    d95f563
  7. parthea
    added 4 commits that reference this issue on Nov 24, 2025

    fix: resolve the issue where rpc timeout of 0 is used when timeout ex…

    9a02bb2

    chore(deps): update dependency google-cloud-pubsub to v2.18.2 (#776)

    8577268

    chore(deps): update dependency google-cloud-pubsub to v2.18.2 (#776)

    ed79c3a

    feat: allow scopes for self signed jwt (#776)

    36f686e
  8. parthea
    added 5 commits that reference this issue on Mar 2, 2026

    chore(python): exclude setup.py in renovate config (#776)

    5a68da5

    fix!: remove out-of-date BigQuery ML protocol buffers (#1178)

    b9c6ec6

    chore(deps): update dependency cachetools to v6.2.1 (#776)

    1c0f246

    chore(python): use ubuntu 22.04 in docs image (#776)

    27a5dec

    chore(main): release 3.18.0 (#776)

    5efb68c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dhermes
    dhermes

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    • Storage Future

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.