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

PR: Separate startup run_lines with semicolon instead of comma #7597

Merged
merged 3 commits into from
Aug 12, 2018

Conversation

bcolsen
Copy link
Member

@bcolsen bcolsen commented Aug 1, 2018

Pull Request Checklist

  • Read and followed this repo's Contributing Guidelines
  • Based your PR on the latest version of the correct branch (master or 3.x)
  • Followed PEP8 for code style
  • Ensured your pull request hasn't eliminated unrelated blank lines/spaces,
    modified the spyder/defaults directory, or added new icons/assets
  • Wrote at least one-line docstrings for any new functions
  • Added at least one unit test covering the changes, if at all possible
  • Described your changes and the motivation for them below
  • Noted what issue(s) this pull request resolves, creating one if needed
  • Included a screenshot, if this PR makes any visible changes to the UI

Description of Changes

Currently IPython startup lines like these won't work in Sypder since the line is parsed with comma separated:

from modual import func1, func2

or

import os, sys

These common python import structures don't work in startup lines. I actually thought it was broken until I read the note in the ipython config and thought about the implications of using comma separation.

Solution

If we use semicolon to separate the lines like you can do in python then any valid python should be possible.

Then you could use:

import os, sys; from modal import func1, func2

Problem

This needs the new config parser form python 3 because semicolons are inline comments in config parser in python 2

Issue(s) Resolved

Associated With:
spyder-ide/spyder-kernels#15

@pep8speaks
Copy link

pep8speaks commented Aug 1, 2018

Hello @bcolsen! Thanks for updating the PR.

Cheers ! There are no PEP8 issues in this Pull Request. 🍻

Comment last updated on August 02, 2018 at 17:17 Hours UTC

@ccordoba12 ccordoba12 added this to the v4.0beta1 milestone Aug 2, 2018
@ccordoba12 ccordoba12 changed the title Separate Startup Run_Lines with semicolon instead of comma PR: Separate startup run_Lines with semicolon instead of comma Aug 2, 2018
@ccordoba12 ccordoba12 changed the title PR: Separate startup run_Lines with semicolon instead of comma PR: Separate startup run_lines with semicolon instead of comma Aug 2, 2018
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

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

Nice, I like it. Thanks @bcolsen!

@ccordoba12
Copy link
Member

I'll merge after releasing a new version of spyder-kernels.

"each one separated by commas, for "
"example:<br>"
"<i>import os, import sys</i>"))
"each one separated by semicolons and a "
Copy link
Member Author

Choose a reason for hiding this comment

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

The semicolon and a space are only needed for python 2.7. Python 3 works without the space

Copy link
Member

@ccordoba12 ccordoba12 Aug 2, 2018

Choose a reason for hiding this comment

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

Ok, I'll add that to our release notes for beta1 when I merge this one.

@ccordoba12 ccordoba12 merged commit f83f817 into spyder-ide:master Aug 12, 2018
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.

3 participants