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 — gh-133722: Add Difflib theme to `_colorize` and 'color' option to `difflib.unified_diff` by dougthor42 · Pull Request #133725 · python/cpython

Conversation

@dougthor42

@dougthor42 dougthor42 commented May 9, 2025 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Add a color arg (defaulting to False) to difflib.unified_diff. When True, ANSI color codes are injected to the diff lines so that the printed result looks like git diff --color:

>>> import difflib
>>> args = [['one', 'three'], ['two', 'three'], 'Original', 'Current']
>>> for line in difflib.unified_diff(*args, lineterm='', color=True):
...     print(line)
...     
--- Original
+++ Current
@@ -1,2 +1,2 @@
-one
+two
 three

image

Fixes #133722.

It's a bummer, I just missed the feature freeze window for 3.14 (it was yesterday! 😭), but c'est la vie!

  • Issue: Add a color: bool arg to difflib.unified_diff #133722

📚 Documentation preview 📚: https://cpython-previews--133725.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
dougthor42 added 4 commits May 8, 2025 19:51
@dougthor42
Add test case
5c5b248
@dougthor42
Add 'color' arg to difflib.unified_diff.
fdc0fa0
Fixes pythongh-133722.
@dougthor42
Update docs and ACKs
fcdd7ab
@dougthor42
blurb
0e9b070
@bedevere-app bedevere-app Bot mentioned this pull request May 9, 2025
Add a color: bool arg to difflib.unified_diff #133722
Closed
@dougthor42
fixup to follow convention
7c31749
@dougthor42
dougthor42 marked this pull request as ready for review May 9, 2025 03:40
@bedevere-app bedevere-app Bot added the awaiting review label May 9, 2025
@tomasr8

tomasr8 commented May 9, 2025

Copy link
Copy Markdown
Member

Thanks for the PR!

With the basic theming support in #133347 merged, perhaps we could define a separate difflib theme and use that here?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hugovk
hugovk reviewed May 9, 2025
View reviewed changes
Comment thread Doc/library/difflib.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@hugovk

hugovk commented May 9, 2025

Copy link
Copy Markdown
Member

Thanks for the PR! I had a play with something similar but didn't get very far before the 3.14 freeze.

With the basic theming support in #133347 merged, perhaps we could define a separate difflib theme and use that here?

Yes, let's add theming support.

See this docstring for instructions.

For a couple of standalone examples of adding theme support to a module, see 230d658 and 5c5c3e1 from that PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dougthor42

dougthor42 commented May 9, 2025

Copy link
Copy Markdown
Contributor Author

Ah, TIL! Thanks, I'll take a look at those docs and update accordingly. It'll be a few days a least before I can get to it, so for now I'll revert this back to draft.

tomasr8 and hugovk reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dougthor42
dougthor42 marked this pull request as draft May 9, 2025 17:14
@bedevere-app bedevere-app Bot removed the awaiting review label May 9, 2025
@hugovk

hugovk commented May 9, 2025

Copy link
Copy Markdown
Member

Absolutely no rush for this, we have 12 months until the 3.15 feature freeze. Don't hesitate if you have questions :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dougthor42 added 5 commits May 10, 2025 21:02
@dougthor42
Add 'Difflib' theme
66475a2
@dougthor42
fixup tests
dbf0547
@dougthor42
Switch to using themes. So easy!
a72012e
@dougthor42
use 'next' in versionchanged docs
2a3d818
@dougthor42
turns out 'git diff' adds reset to the start and end of context lines
252982e
dougthor42
dougthor42 commented May 11, 2025
View reviewed changes

@dougthor42 dougthor42 left a comment

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow that was really easy! The examples helped a lot too, thanks! PTAL at your leisure.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/difflib.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@dougthor42
dougthor42 marked this pull request as ready for review May 11, 2025 04:38
@bedevere-app bedevere-app Bot added the awaiting review label May 11, 2025
@dougthor42 dougthor42 changed the title gh-133722: Add 'color' option to 'difflib.unified_diff' gh-133722: Add Difflib theme to _colorize and 'color' option to difflib.unified_diff May 11, 2025
dougthor42
dougthor42 commented May 11, 2025
View reviewed changes
Comment thread Lib/_colorize.py Outdated
Comment on lines +215 to +217
equal: str = ANSIColors.RESET # context lines
insert: str = ANSIColors.GREEN
delete: str = ANSIColors.RED

@dougthor42 dougthor42 May 11, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opted to use the difflib.context_diff internal terminology here. Should I use the more git-like terms context, added, and removed instead?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@hugovk hugovk May 11, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, maybe the Git-like terms if they're going to be more familiar with people and if the difflib ones are all internal.

Where does Git mention them?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@dougthor42 dougthor42 May 14, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall they are defined in the GNU unified diff detailed description.

The git diff man page mentions them in a variety of places (emphasis mine):

-U
--unified=

Generate diffs with lines of context instead of the usual three. Implies --patch.

Generating patch text with -p

  1. Hunk headers mention the name of the function to which the hunk applies.

plain

Any line that is added in one location and was removed in another location will be colored with color.diff.newMoved.

Though sometimes it uses "deleted" instead of "removed":

--numstat

Similar to --stat, but shows number of added and deleted lines


I've gone ahead and switched to the GNU unified diff terms prior to the requested sorting. Also, to keep consistent with the other dataclass attributes (which are not currently sorted), the reset value was left at the end.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
ZeroIntensity
ZeroIntensity reviewed May 11, 2025
View reviewed changes

@ZeroIntensity ZeroIntensity left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I would expect to see this in the difflib CLI rather than a library function. But, as it turns out, difflib doesn't have a working CLI? That's different than what's documented.

I personally think it's worth adding one if we're going through the effort to add colorization.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
hugovk
hugovk reviewed May 11, 2025
View reviewed changes

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also add a What's New entry, perhaps something similar to https://docs.python.org/3.14/whatsnew/3.14.html#whatsnew314-color-argparse

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/difflib.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/difflib.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/_colorize.py Outdated
Comment on lines +215 to +217
equal: str = ANSIColors.RESET # context lines
insert: str = ANSIColors.GREEN
delete: str = ANSIColors.RED

@hugovk hugovk May 11, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, maybe the Git-like terms if they're going to be more familiar with people and if the difflib ones are all internal.

Where does Git mention them?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/_colorize.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/_colorize.py Outdated
Comment on lines +229 to +232
syntax: Syntax = field(default_factory=Syntax)
traceback: Traceback = field(default_factory=Traceback)
unittest: Unittest = field(default_factory=Unittest)
difflib: Difflib = field(default_factory=Difflib)

@hugovk hugovk May 11, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here:

Suggested change
syntax: Syntax = field(default_factory=Syntax)
traceback: Traceback = field(default_factory=Traceback)
unittest: Unittest = field(default_factory=Unittest)
difflib: Difflib = field(default_factory=Difflib)
difflib: Difflib = field(default_factory=Difflib)
syntax: Syntax = field(default_factory=Syntax)
traceback: Traceback = field(default_factory=Traceback)
unittest: Unittest = field(default_factory=Unittest)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@dougthor42 dougthor42 May 14, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm very slightly concerned about sorting when the dataclasses aren't kw_only.

Should I update the dataclass decorator to include kw_only=True and then sort? Or is that out of scope of this PR?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ambv reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@hugovk hugovk May 15, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's ask @ambv about this.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ambv reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@ambv ambv May 29, 2025

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this suggestion.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@dougthor42 dougthor42 May 29, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Done

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/_colorize.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/difflib.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/difflib.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/difflib.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Misc/NEWS.d/next/Library/2025-05-08-20-03-20.gh-issue-133722.1-B82a.rst Outdated
@@ -0,0 +1,2 @@
Added a ``color`` option to :func:`difflib.unified_diff` that injects ANSI color

@hugovk hugovk May 11, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Added a ``color`` option to :func:`difflib.unified_diff` that injects ANSI color
Added a *color* option to :func:`difflib.unified_diff` that injects ANSI color

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@dougthor42 dougthor42 May 14, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@hugovk hugovk May 19, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still todo :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@dougthor42 dougthor42 May 20, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
dougthor42 added 3 commits May 13, 2025 20:11
@dougthor42
Use GNU unified diff terms
3422fa7
@dougthor42
move class
bffdd71
@dougthor42
kw-only the 'color' arg
3255866
dougthor42 added 2 commits May 13, 2025 20:21
@dougthor42
Sort the things that are safe to sort without kw_only=True
8ca50fa
@dougthor42
Update what's new
eb0e81e
dougthor42
dougthor42 commented May 14, 2025
View reviewed changes

@dougthor42 dougthor42 left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's New entry

Added, assuming a 3.15 release.


I would expect to see this in the difflib CLI rather than a library function.

My underlying use case and request is specific to the library function. That said, I agree that any CLI should also include coloring.

difflib doesn't have a working CLI? That's different than what's documented.

Hmm... I'm not able to find the difflib CLI docs? The closest thing I found was https://docs.python.org/3/library/difflib.html#difflib-interface but that just looks like an example of how to make a CLI for difflib. Was that what you were thinking of?

If I actually read the comment I would have seen that the docs were indeed linked... And yes, the linked item is just an example of how one might make a CLI for difflib.

I personally think it's worth adding one if we're going through the effort to add colorization.

I'd be happy to modify any existing CLI code to include colors. I can't say I'd have the time to add a CLI though.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/difflib.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/difflib.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/_colorize.py Outdated
Comment on lines +215 to +217
equal: str = ANSIColors.RESET # context lines
insert: str = ANSIColors.GREEN
delete: str = ANSIColors.RED

@dougthor42 dougthor42 May 14, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall they are defined in the GNU unified diff detailed description.

The git diff man page mentions them in a variety of places (emphasis mine):

-U
--unified=

Generate diffs with lines of context instead of the usual three. Implies --patch.

Generating patch text with -p

  1. Hunk headers mention the name of the function to which the hunk applies.

plain

Any line that is added in one location and was removed in another location will be colored with color.diff.newMoved.

Though sometimes it uses "deleted" instead of "removed":

--numstat

Similar to --stat, but shows number of added and deleted lines


I've gone ahead and switched to the GNU unified diff terms prior to the requested sorting. Also, to keep consistent with the other dataclass attributes (which are not currently sorted), the reset value was left at the end.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/_colorize.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/_colorize.py Outdated
Comment on lines +229 to +232
syntax: Syntax = field(default_factory=Syntax)
traceback: Traceback = field(default_factory=Traceback)
unittest: Unittest = field(default_factory=Unittest)
difflib: Difflib = field(default_factory=Difflib)

@dougthor42 dougthor42 May 14, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm very slightly concerned about sorting when the dataclasses aren't kw_only.

Should I update the dataclass decorator to include kw_only=True and then sort? Or is that out of scope of this PR?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ambv reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Misc/NEWS.d/next/Library/2025-05-08-20-03-20.gh-issue-133722.1-B82a.rst Outdated
@@ -0,0 +1,2 @@
Added a ``color`` option to :func:`difflib.unified_diff` that injects ANSI color

@dougthor42 dougthor42 May 14, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/_colorize.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/_colorize.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/_colorize.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_difflib.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@dougthor42

dougthor42 commented May 14, 2025

Copy link
Copy Markdown
Contributor Author

Hmm... I'm not able to find the difflib CLI docs? The closest thing I found

@ZeroIntensity Doh! I just re-read your comment and realized you linked to it haha.

Anyway yeah that's just example code. To my knowledge there is no official CLI for difflib.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dougthor42 added 2 commits May 13, 2025 20:57
@dougthor42
Merge remote-tracking branch 'upstream/main' into difflib-color-gh133722
f7b34c3
@dougthor42
fixup docs
fb092b0
hugovk
hugovk reviewed May 19, 2025
View reviewed changes
Comment thread Doc/library/difflib.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/whatsnew/3.15.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/whatsnew/3.15.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/_colorize.py Outdated
Comment on lines +229 to +232
syntax: Syntax = field(default_factory=Syntax)
traceback: Traceback = field(default_factory=Traceback)
unittest: Unittest = field(default_factory=Unittest)
difflib: Difflib = field(default_factory=Difflib)

@hugovk hugovk May 15, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's ask @ambv about this.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ambv reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Lib/difflib.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/difflib.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_difflib.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Misc/NEWS.d/next/Library/2025-05-08-20-03-20.gh-issue-133722.1-B82a.rst Outdated
@@ -0,0 +1,2 @@
Added a ``color`` option to :func:`difflib.unified_diff` that injects ANSI color

@hugovk hugovk May 19, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still todo :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
dougthor42 added 3 commits May 19, 2025 21:04
@dougthor42
fixup docs
734b0bc
@dougthor42
Code review: docs, whatsnew, f-strings, news
8a10e40
@dougthor42
force_colorized
57b80d1
@Wulian233

Wulian233 commented May 28, 2025

Copy link
Copy Markdown
Contributor

This PR needs to be updated to resolve the conflicts → #134581

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dougthor42

dougthor42 commented May 28, 2025

Copy link
Copy Markdown
Contributor Author

ACK @Wulian233. I was planning on waiting to resolve conflicts until after @ambv comments on #133725 (comment).

ambv and Wulian233 reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ambv

ambv commented May 29, 2025

Copy link
Copy Markdown
Contributor

@dougthor42 I responded on that comment. It's a good suggestion to make the dataclasses kwonly.

dougthor42 reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dougthor42 added 2 commits May 28, 2025 21:56
@dougthor42
kw_only
c235425
@dougthor42
Merge branch 'main' into difflib-color-gh133722
387cfe6
hugovk
hugovk approved these changes Jun 9, 2025
View reviewed changes

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/difflib.py Outdated
Comment on lines +1115 to +1117
Set *color* to ``True`` to enable output in color, similar to
:program:`git diff --color`. Even if enabled, it can be
:ref:`controlled using environment variables <using-on-controlling-color>`.

@hugovk hugovk Jun 9, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CPython docstrings aren't rendered into docs, so let's use plain formatting like elsewhere. Perhaps:

Suggested change
Set *color* to ``True`` to enable output in color, similar to
:program:`git diff --color`. Even if enabled, it can be
:ref:`controlled using environment variables <using-on-controlling-color>`.
Set 'color' to True to enable output in color, similar to
'git diff --color'. Even if enabled, it can be
controlled using environment variables such as 'NO_COLOR'.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@dougthor42 dougthor42 Jun 11, 2025

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Also fixed the 3 spaces thing 🤦

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Jun 9, 2025
Wulian233
Wulian233 reviewed Jun 9, 2025
View reviewed changes
Comment thread Doc/whatsnew/3.15.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@dougthor42
documentation updates per code review
833d86a
Wulian233
Wulian233 approved these changes Jun 11, 2025
View reviewed changes
@dougthor42
Merge branch 'main' into difflib-color-gh133722
25f9d80
@python-cla-bot

python-cla-bot Bot commented Jul 18, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk
hugovk merged commit 34d7351 into python:main Aug 8, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label Aug 8, 2025
@hugovk

hugovk commented Aug 8, 2025

Copy link
Copy Markdown
Member

Thank you!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dougthor42
dougthor42 deleted the difflib-color-gh133722 branch August 10, 2025 21:59
Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request Aug 19, 2025
@dougthor42 @Agent-Hellboy
pythongh-133722: Add Difflib theme to _colorize and 'color' option …
2d1c812
…to `difflib.unified_diff` (python#133725)
This was referenced May 8, 2026
Python 3.15: sort allowlists, more small updates python/typeshed#15714
Merged
Add Python 3.15 calendar datetime and difflib updates python/typeshed#15729
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ambv ambv ambv left review comments
@ZeroIntensity ZeroIntensity ZeroIntensity left review comments
@hugovk hugovk hugovk approved these changes
+1 more reviewer
@Wulian233 Wulian233 Wulian233 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add a color: bool arg to difflib.unified_diff

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@dougthor42 @tomasr8 @hugovk @Wulian233 @ambv @ZeroIntensity
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — 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.