Elektrine
EN
Log in Register
Paige Chat Timeline Communities Gallery Videos Email DNS VPN Uptime Kairo
Back to Timeline
Remote

Paul McGuire

@ptmcg@fosstodon.org
mastodon 4.6.6
  • 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

0 Followers
0 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

Posts

Open post
ptmcg
Paul McGuire @ptmcg@fosstodon.org · May 03, 2026
Paul McGuire
@ptmcg@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

fosstodon.org
Replying to @pythonbynight@hachyderm.io
@pythonbynight@hachyderm.io Yes! I'll be there!
1
0
2
0
Open post
ptmcg
Paul McGuire @ptmcg@fosstodon.org · Apr 25, 2026
Paul McGuire
@ptmcg@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

fosstodon.org
Replying to @ptmcg@fosstodon.org
@catsalad@infosec.exchange Other adventures in valid Python identifiers: https://fosstodon.org/@ptmcg/113929881516528637
11
1
2
0
Open post
ptmcg
Paul McGuire @ptmcg@fosstodon.org · Apr 25, 2026
Paul McGuire
@ptmcg@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

fosstodon.org
Replying to @hcf@infosec.exchange
@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
ptmcg
Paul McGuire @ptmcg@fosstodon.org · Apr 25, 2026
Paul McGuire
@ptmcg@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

fosstodon.org
Replying to @catsalad@infosec.exchange

@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
ptmcg
Paul McGuire @ptmcg@fosstodon.org · Mar 08, 2026
Paul McGuire
@ptmcg@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

fosstodon.org
Replying to @zauberlaus@chaos.social

@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
ptmcg
Paul McGuire @ptmcg@fosstodon.org · Mar 08, 2026
Paul McGuire
@ptmcg@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

fosstodon.org
Replying to @tartley@fosstodon.org

@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
ptmcg
Paul McGuire @ptmcg@fosstodon.org · Mar 08, 2026
Paul McGuire
@ptmcg@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

fosstodon.org
Replying to @ptmcg@fosstodon.org

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
ptmcg
Paul McGuire @ptmcg@fosstodon.org · Mar 07, 2026
Paul McGuire
@ptmcg@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

fosstodon.org

I saw a TIL post on bsky today about using '/' with pathlib.Path's. Some other features recently added to #python
- itertools.batched (3.12)
- accessing re.Match groups using m[1] notation (faster than calling m.group(1)) (3.6)
- 1_000_000 is a legal syntax for 1000000 (3.6)
- command-line access to stdlib modules (python -m )
- uuid (3.12)
- json (3.14)
- random (3.13)
- sqlite3 (3.12)
- http.server (3.4)
- f-strings (3.6)
- true multithreading (3.14)
- contextlib.chdir (3.11)

fosstodon.org

Fosstodon

18
8
17
0
Open post
ptmcg
Paul McGuire @ptmcg@fosstodon.org · Jun 05, 2025
Paul McGuire
@ptmcg@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

fosstodon.org
Replying to @sethmlarson@fosstodon.org
@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
ptmcg
Paul McGuire @ptmcg@fosstodon.org · Feb 01, 2025
Paul McGuire
@ptmcg@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

fosstodon.org
Replying to @thias@mastodon.social
@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
Open post
ptmcg
Paul McGuire @ptmcg@fosstodon.org · Feb 01, 2025
Paul McGuire
@ptmcg@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

fosstodon.org

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

Remote instance

fosstodon.org
Open on original server
313k7r1n3
Elektrine

Tor hidden service

elekhj7afj4qnrr4yd3bkzslsyo5jgfxw3orgjkhlcxifueodybyiiad.onion

Platform

  • Email
  • Chat
  • Timeline
  • Communities
  • VPN
  • DNS

Company

  • About
  • Contact
  • FAQ

Legal

  • Terms of Service
  • Privacy Policy
  • Warrant Canary
  • Lite (no JS)
  • VPN Policy
  • Source code

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: 21:01:49 UTC