Skip to content

Remove dead code and stale Python 2 leftovers (with the help of Claude Fable) - #947

Merged
Carreau merged 1 commit into
ipython:mainfrom
Carreau:f2
Jul 14, 2026
Merged

Remove dead code and stale Python 2 leftovers (with the help of Claude Fable)#947
Carreau merged 1 commit into
ipython:mainfrom
Carreau:f2

Conversation

@Carreau

@Carreau Carreau commented Jul 13, 2026

Copy link
Copy Markdown
Member
  • ClassTypes tuple in traitlets.py, a Python 2/3 compat constant never used and not exported
  • execfile() shim in config/loader.py, shadowing the removed Python 2 builtin, never called
  • Config._merge in config/loader.py, a deprecated private alias for Config.merge that was never called and never warned

All verified unreferenced across the package, tests, and docs:

- ClassTypes tuple in traitlets.py, a Python 2/3 compat constant never
  used and not exported
- execfile() shim in config/loader.py, shadowing the removed Python 2
  builtin, never called
- Config._merge in config/loader.py, a deprecated private alias for
  Config.merge that was never called and never warned
@Carreau
Carreau merged commit 2442d86 into ipython:main Jul 14, 2026
34 of 35 checks passed
@ccordoba12

Copy link
Copy Markdown
Member

Config._merge in config/loader.py, a deprecated private alias for Config.merge that was never called and never warned

@Carreau, unfortunately this change broke both Spyder and Spyder-kernels. Could you release 5.16.1 reverting it? That would give us time to address it in versions 6.1.7/3.1.6 of those packages, to be released at the end of August.

By the way, I don't remember why we're using _merge (perhaps because there was no merge at the time we wanted to merge configs), but it's been a stable API for at least 10 years.

@Carreau

Carreau commented Aug 1, 2026

Copy link
Copy Markdown
Member Author

just _merge? nothing else ?

I'll do that on monday.

@Carreau

Carreau commented Aug 1, 2026

Copy link
Copy Markdown
Member Author

Please feel free to send a PR next time (And see #963 for _merge)

And _merge had been marked as deprecated for at least 11 years; plus there is a leading underscore, so it's technically private.

@ccordoba12

Copy link
Copy Markdown
Member

just _merge? nothing else ?

I think so. I mean, that's what I saw in our failing tests. But I'll check more thoroughly during the weekend.

I'll do that on monday.

Thanks!

Please feel free to send a PR next time (And see #963 for _merge)

Will do. I just wanted to see first if you were ok with the idea.

And _merge had been marked as deprecated for at least 11 years; plus there is a leading underscore, so it's technically private.

As I said, I don't recall why we use _merge. Perhaps we started to use it more than 11 years ago. And sure, we should have changed it but you know how the life of a maintainer is.

@Carreau

Carreau commented Aug 1, 2026

Copy link
Copy Markdown
Member Author

We should also start to publish nightly of traitlets maybe.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants