Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

RFE: Give Commit objects a replace method that returns new Commit with modified attributes #1123

Closed
@larsks

Description

@larsks

Thedatetime objects produced by Python'sdatetime module are immutable, much likeCommit objects. Thedatetime module provides a convenientreplace function that returns a new object based on an old with one or more attributes replaced. E.g, I can write:

>>> d = datetime.datetime.now()>>> d.replace(hour=0, minute=0, second=0)datetime.datetime(2021, 2, 15, 0, 0, 0, 318021)

I would like to see the same api onCommit objects, so that one could write:

>>> newcommit = oldcommit.replace(message='This is a test', author='Cookie Monster')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp