Skip to content

Refactor banner property logic#15314

Open
xavya-dev wants to merge 4 commits into
ipython:mainfrom
xavya-dev:patch-1
Open

Refactor banner property logic#15314
xavya-dev wants to merge 4 commits into
ipython:mainfrom
xavya-dev:patch-1

Conversation

@xavya-dev

Copy link
Copy Markdown
Contributor

Refactor banner property to check SOURCE_DATE_EPOCH environment variable directly.

@collares

collares commented Jul 15, 2026

Copy link
Copy Markdown

This PR removes a redundant condition in the current code, but the redundant condition was due to a typo in #15208. I believe the correct fix is to replace banner is self.banner1 by banner is default_banner, which wouldn't be redundant anymore.

cc @tornaria

@collares

collares commented Jul 15, 2026

Copy link
Copy Markdown

Or perhaps just banner == default_banner, since I believe default_banner is copied into self.banner1 instead of assigned.

@xavya-dev

Copy link
Copy Markdown
Contributor Author

Thanks for the suggestion! Just to confirm, should I update the if condition to check if banner == default_banner instead of removing it entirely? I can update this PR with that change.

@collares

Copy link
Copy Markdown

I just tested and banner is default_banner seems to work, and it should be faster. So, yes, the suggestion I'm making is to replace the condition banner is self.banner1 by banner is default_banner, which is essentially what @tornaria suggested in #15208.

@collares

Copy link
Copy Markdown

Wait, wait, I was testing banner == default_banner, which explains why it's working. Let me test the other variant.

@collares

Copy link
Copy Markdown

Seems like banner is default_banner indeed works as well.

Comment thread IPython/core/interactiveshell.py Outdated
Comment thread IPython/core/interactiveshell.py Outdated
xavya-dev and others added 3 commits July 22, 2026 18:46
Refactor banner property to check SOURCE_DATE_EPOCH environment variable directly.
Co-authored-by: Gonzalo Tornaría <tornaria@cmat.edu.uy>
Co-authored-by: Gonzalo Tornaría <tornaria@cmat.edu.uy>
@Carreau
Carreau force-pushed the patch-1 branch 3 times, most recently from 4f58d77 to 795bf0a Compare July 23, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants