You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_ can be used as a variable name in Python (seen occasionally as a throwaway variable when developing). We likely hide this variable name since it is part of the ipython user namespace, but it was surprising to not see it populated when I set it. To reproduce:
>>> _ =1>>>print(_)
1
You'll see that _ does get set to 1 correctly, but it won't be shown in Variables.
The text was updated successfully, but these errors were encountered:
…6297)
<!-- Thank you for submitting a pull request.
If this is your first pull request you can find information about
contributing here:
* https://github.com/posit-dev/positron/blob/main/CONTRIBUTING.md
We recommend synchronizing your branch with the latest changes in the
main branch by either pulling or rebasing.
-->
<!--
Describe briefly what problem this pull request resolves, or what
new feature it introduces. Include screenshots of any new or altered
UI. Link to any GitHub issues but avoid "magic" keywords that will
automatically close the issue. If there are any details about your
approach that are unintuitive or you want to draw attention to, please
describe them here.
-->
Addresses #3366. This PR changes the Variables pane behavior in the
Python extension so that it no longer hides the `_` variable if it was
explicitly changed by the user.
An example: type `_ = 1` into the console. Before this change, `_`
wouldn't show up. Now it does.
### Release Notes
<!--
Optionally, replace `N/A` with text to be included in the next release
notes.
The `N/A` bullets are ignored. If you refer to one or more Positron
issues,
these issues are used to collect information about the feature or
bugfix, such
as the relevant language pack as determined by Github labels of type
`lang: `.
The note will automatically be tagged with the language.
These notes are typically filled by the Positron team. If you are an
external
contributor, you may ignore this section.
-->
#### New Features
- N/A
#### Bug Fixes
- Allowed `_` to show up in the Python Variables pane if defined by the
user. (#3366)
### QA Notes
<!--
Add additional information for QA on how to validate the change,
paying special attention to the level of risk, adjacent areas that
could be affected by the change, and any important contextual
information not present in the linked issues.
-->
Try messing around with the `_` variable; it should work like other
variables in the Variables pane. Examples:
```py
_ = 1
_ = 2
_ = [1] * 1000
del _
from ibis import _
```
(the last one requires `pip install ibis-framework`)
@:console @:variables
_
can be used as a variable name in Python (seen occasionally as a throwaway variable when developing). We likely hide this variable name since it is part of the ipython user namespace, but it was surprising to not see it populated when I set it. To reproduce:You'll see that
_
does get set to 1 correctly, but it won't be shown in Variables.The text was updated successfully, but these errors were encountered: