support for unicode identifiers in ?, ??#12208
Merged
Carreau merged 1 commit intoipython:masterfrom Mar 28, 2020
mwageringel:unicode_identifiers
Merged
support for unicode identifiers in ?, ??#12208Carreau merged 1 commit intoipython:masterfrom mwageringel:unicode_identifiers
?, ??#12208Carreau merged 1 commit intoipython:masterfrom
mwageringel:unicode_identifiers
Conversation
This rewrites some of the regular expressions that are used to match
Python identifiers, so that they are unicode compatible. In Python 3,
identifiers can contain unicode characters as long as the first
character is not numeric.
Examples for the changes:
• inputtransformer:
```
In [1]: π = 3.14
In [2]: π.is_integer?
Object `is_integer` not found.
```
----------
• namespace:
```
π.is_integ*?
```
or
```
In [1]: %psearch π.is_integ
Python identifiers can only contain ascii characters.
```
----------
• prefilter:
```
%autocall 1
φ = float
get_ipython().prefilter("φ 3") # should be 'φ(3)', but returns 'φ 3'
```
----------
• completerlib:
If there is a file e.g. named `π.py` in the current directory, then
```
import IPython
IPython.core.completerlib.module_list('.') # should contain module 'π'
```
Member
|
Oh ! Nice catch ! Thanks ! |
meeseeksmachine
pushed a commit
to meeseeksmachine/ipython
that referenced
this pull request
Mar 28, 2020
Carreau
added a commit
that referenced
this pull request
Mar 29, 2020
…208-on-7.x Backport PR #12208 on branch 7.x (support for unicode identifiers)
?, ??
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This rewrites some of the regular expressions that are used to match Python identifiers, so that they are unicode compatible. In Python 3, identifiers can contain unicode characters as long as the first character is not numeric.
Examples for the changes:
• inputtransformer:
• namespace:
or
• prefilter:
• completerlib:
If there is a file e.g. named
π.pyin the current directory, then