Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core\unstack] Deprecate unstack.discard #1877

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

RickBarretto
Copy link
Collaborator

Description

Updates Documentation (with the example of the discard function) and deprecates the attribute. Also updates depending parts of the deprecated one, like the console.art.

Fixes #1870

Demo

image
image

Type of change

  • Code cleanup
  • Unit tests (added or updated unit-tests)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (implementation update, or general performance enhancements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (documentation-related additions)

@github-actions github-actions bot added repl Issues related to the REPL library Issues related to the standard library → Core labels Feb 5, 2025
Comment on lines 1457 to +1458
if x.i==1:
if doDiscard: discard stack.pop()
else: discard
discard
Copy link
Collaborator

@drkameleon drkameleon Feb 7, 2025

Choose a reason for hiding this comment

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

I'm seriously confused here (perhaps I haven't properly woken up yet, or sth lol):

  • why isn't that push(stack.pop()) ?!

P.S. I'm not saying you did anything wrong; I'm just totally baffled by how it already was... you merely eliminated the if doDiscard clause. I mean... the original point here - I guess - was to return a single element (vs a block of elements) when unstack 1, but apparently we haven't been returning anything?! 🤔 We'll have to check this to make sure (and not just in the REPL 😉 )

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ohh, alright! Sorry for delaying, I didn't noticed this message.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ohh, alright! Sorry for delaying, I didn't noticed this message.

No worries! 😉
And also, it's something we have to check... It appears obvious, but is it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
→ Core library Issues related to the standard library repl Issues related to the REPL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Core\unstack] deprecate .discard
2 participants