5 ms·
Python now as a semi-shortcut for this (just add = to the end of any f-string expression): In [8]: print(f'{foo.bar[1]=}') foo.bar[1]='2' You can do more comp
by orf 6y ago
Python now as a semi-shortcut for this (just add = to the end of any f-string expression):
In [8]: print(f'{foo.bar[1]=}')
foo.bar[1]='2'
You can do more complex expressions:
In [9]: f'{1+1=}'
Out[9]: '1+1=2'
It's not quite as fluid as dbg!(), but it's nice.
- gknoy 6y agoFor anyone else wondering why we get a syntax error, this seems to be new in 3.8. :)
- giancarlostoro 6y agoSo anyone using Ubuntu or Debian, maybe for the next major release you can try it out. I love Debian but I hate that I cant just install the latest of Python system wide without potentially breaking system level scripts.
- Drdrdrq 6y agoJust use pyenv (careful with spelling), then you can use any version you like.
- giancarlostoro 6y agoDefinitely will have to check it out with two endorsements, I've heard of a few other options, but this might be something I'm actually okay with.
- 0x008 6y agoWhat alternatives are there for pyenv besides conda?
- Nullabillity 6y agoNix?
- ageofwant 6y agoSystem Python is for the system, leave it alone. Use https://github.com/pyenv/pyenv https://github.com/pyenv/pyenv and get every Python you want in seconds for your personal use.
- raziel2p 6y agoIf you don't want to use pyenv (I think it's a mess), just look into compiling Python yourself, using a prefix like ~/.local/share/python-$version