6

ENH: 🐍 snake by tacaswell · Pull Request #1686 · python/cpython · GitHub

 1 year ago
source link: https://github.com/python/cpython/pull/1686
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Contributor

@tacaswell tacaswell commented on May 20, 2017

Special case the identifier validation to allow snake to be used in
identifiers


This works in the terminal (assuming you have the right fonts, showing both with and without mark up as the snake do not render for me in the escaped code)

(bleeding) ✔ ~                                                                                                    
18:38 $ python
Python 3.7.0a0 (heads/enh_🐍_snek:2bfe3d18dad, May 20 2017, 18:32:35)                                             
[GCC 6.3.1 20170306] on linux                                                                                     
Type "help", "copyright", "credits" or "license" for more information.                                            
>>> 🐍 = 1
>>> 🐍 + 🐍 
2                                                                                                                 
>>>                                                                                                               
(bleeding) ✔ ~  

(bleeding) heavy_check_mark ~
18:38 $ python
Python 3.7.0a0 (heads/enh_snake_snek:2bfe3d18dad, May 20 2017, 18:32:35)
[GCC 6.3.1 20170306] on linux
Type "help", "copyright", "credits" or "license" for more information.

snake = 1
snake + snake
2

(bleeding) heavy_check_mark ~

tsn

It also works in the jupyter notebook (again assuming you have the right fonts)

sn
drdaxxy, Artoria2e5, captainsafia, kailukowiak, and schneiderfelipe reacted with thumbs up emojiklauer, hhslepicka, and schneiderfelipe reacted with laugh emojiamrrs and schneiderfelipe reacted with eyes emoji All reactions

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK