Elektrine
Log in Register
Paige Chat Timeline Gallery Friends Email Drive DNS Private DNS Domains VPN Kairo Nerve
Remote

Paul McGuire

@ptmcg@fosstodon.org
mastodon 4.7.3
  • Open on fosstodon.org

he/him - Author/maintainer of #pyparsing, #littletable, #plusminus - I do digital art when I get the time. Co-author of "Python in a Nutshell, 4th Ed". PSF Fellow. Avatar: NAT #python #pynutshell4

429 Followers
487 Following
11 Posts
Joined May 08, 2022
Blog:
https://thingspython.wordpress.com/
Art website:
https://paulmcguireart.com
Twitter:
@̶p̶t̶m̶c̶g̶u̶i̶r̶e̶
Github:
https://github.com/ptmcg
Open post
Paul McGuire @ptmcg@fosstodon.org
· 5mo ago
Replying to
@catsalad@infosec.exchange Other adventures in valid Python identifiers: https://fosstodon.org/@ptmcg/113929881516528637
fosstodon.org

Paul McGuire: "Here are some emojidentifiers for your next Pytho…" - Fosstodon

11
1
2
0
Open post
Paul McGuire @ptmcg@fosstodon.org
· 20mo ago

Here are some emojidentifiers for your next Python code:

import math
乁_ツ_ㄏ = None
乁_益_ㄏ = math.nan
ఠ_ఠ = isinstance

def minnums(values: list | 乁_ツ_ㄏ = 乁_ツ_ㄏ):
if (
values is 乁_ツ_ㄏ
or not all(ఠ_ఠ(n, (float, int))
for n in values)
):
return 乁_益_ㄏ
return min(values)

#python #unicode #emoji

fosstodon.org

Fosstodon

40
4
21
1
Open post
Paul McGuire @ptmcg@fosstodon.org
· 7mo ago
Replying to

And these simplifications to type hints:

  • typing simplifications
    • List, Dict, Tuple, etc. -> list, dict, and tuple (3.9)
    • Union[X, Y] and Optional[X] -> X|Y and X|None (3.10)
    • no more class Z(Generic[T]), just class Z[T] (3.12)
    • also def last[T](seq: Sequence[T]) -> T (3.12)
    • 'type' as a statement (3.12)
6
2
1
0
Open post
Paul McGuire @ptmcg@fosstodon.org
· 7mo ago
Replying to

@zauberlaus@chaos.social It is one of a few stdlib modules that have added command-line functionality, along with uuid, random, sqlite3, etc. json is a little different because it previously released the json.tool command-line function, but now in 3.14 it is exposed as just json, so python -m json - a Python version of jq.

2
2
0
0
Open post
Paul McGuire @ptmcg@fosstodon.org
· 7mo ago
Replying to

@tartley@fosstodon.org Thanks for posting the article. asyncio has been off my radar for a while, but I'm delving into it more and more these days. Another recent addition is asyncio.to_thread(). It's a nice way to async-ify a synchronous call, though its really just a convenience form of asyncio.run_in_executor(). I've looked at TaskGroup a little, but I'll revisit after I read your article in a little more depth.

2
0
0
0
Open post
Paul McGuire @ptmcg@fosstodon.org
· 5mo ago
Replying to
@pythonbynight@hachyderm.io Yes! I'll be there!
1
0
2
0
Open post
Paul McGuire @ptmcg@fosstodon.org
· 5mo ago
Replying to

@catsalad@infosec.exchange It's not 1 but 2 characters: _· This is a legal variable name in Python. The second character is the Unicode MIDDLE DOT. It is only legal as a body character, not an initial character, so you need the leading "_".

1
1
0
0
Open post
Paul McGuire @ptmcg@fosstodon.org
· 5mo ago
Replying to
@hcf@infosec.exchange @catsalad@infosec.exchange Sadly, Python rejects this. There are a limited number of leading characters for variable names (although Unicode denormalized versions of them are valid), but emojis aren't among them.
1
0
0
0
Open post
Paul McGuire @ptmcg@fosstodon.org
· 16mo ago
Replying to
@sethmlarson Sadly, the releases for 3.12 and earlier are uninstallable on my Windows machine, nor on the vast majority of Windows machines whose owners don't know or don't care to maintain a Windows C build environment. (And why no binary for 3.12, btw, which is still in bugfix release?)
0
0
0
0
Open post
Paul McGuire @ptmcg@fosstodon.org
· 20mo ago
Replying to
@thias@mastodon.social I was going for the more visual "shrug" emoji look. 無 is a perfectly valid Python identifier, if you prefer. But I wouldn't call it an emojidentifier. (Unfortunately, most Unicode emoji aren't valid identifier characters, so we have to fake it with lookalike characters.)
0
0
0
0
Back
313k7r1n3
Elektrine

Tor hidden service

elekhj7afj4qnrr4yd3bkzslsyo5jgfxw3orgjkhlcxifueodybyiiad.onion

I2P eepsite

j6b6cyk6gjmepjih7jjadxgxvvf3lzzujljuu2v4biemzpg3naya.b32.i2p

Platform

  • Email
  • Chat
  • Timeline
  • VPN
  • DNS

Company

  • About
  • Contact
  • FAQ
  • Lite (no JS)

Legal

  • Terms of Service
  • Privacy Policy
  • Transparency Report
  • Report Abuse
  • Warrant Canary
  • VPN Policy

Support

  • support@elektrine.com
  • Report Security Issue
Mail client setup IMAP mail.elektrine.com:993 POP3 mail.elektrine.com:995 SMTP mail.elektrine.com:465
© 2026 Elektrine. All rights reserved. Server: 23:17:52 UTC