Skip to content

Instantly share code, notes, and snippets.

@kg583
Created August 7, 2022 22:42
Show Gist options
  • Save kg583/74dcf08574bb37f13be6fd978279bd6e to your computer and use it in GitHub Desktop.
Save kg583/74dcf08574bb37f13be6fd978279bd6e to your computer and use it in GitHub Desktop.
Hello World! with only 2 distinct punctuation marks
from operator import attrgetter
from operator import itemgetter
@itemgetter
@slice
@int
@next
@reversed
@str
@len
@str
class IterEmptier:
pass
@itemgetter
@len
@str
class JoinFinder___________________________:
pass
@attrgetter
@JoinFinder___________________________
@dir
@lambda _: str
class JoinGetter:
pass
@JoinGetter
@IterEmptier
@str
class Join:
pass
@itemgetter
@slice
@int
@next
@reversed
@str
@len
@str
class Five__:
pass
@itemgetter
@slice
@int
@next
@reversed
@str
@len
@str
class Seven___:
pass
@attrgetter
@next
@iter
@dir
@lambda _: str
class Adder:
pass
@Adder
@Join
@Five__
@list
@reversed
@Seven___
@list
@reversed
@str
class Hello:
pass
@Adder
@Hello
@chr
@len
@str
class ThirtyTwo____:
pass
@Adder
@ThirtyTwo____
@Join
@Five__
@list
@reversed
@Seven___
@list
@reversed
@str
class World:
pass
@print
@World
@chr
@len
@str
class ThirtyThree___:
pass
@kg583
Copy link
Author

kg583 commented Aug 8, 2022

This abomination was inspired by a general project to reduce punctuation in Python without resorting to exec. For any Python code, only four distinct punctuation marks are necessary, as demonstrated here.

@Arcitec
Copy link

Arcitec commented Aug 8, 2022

This is disgusting. I love it.

@kyteware
Copy link

kyteware commented Aug 8, 2022

I'm impressed and scared for my life.

@davidasamy
Copy link

oh my

@Capaldi12
Copy link

@lambda _: str

How is this allowed?

@Diapolo10
Copy link

This is so evil, I love it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment