Just one question: why?
You can put spoilers in posts or comments this way:
Title
Secret
Here is how it renders:
Title
Secret
(AFAIK apps don't render these correctly, only the website)
Can confirm not hiding on Memmy
Same on Jerboa. Though given the apps' fast development progress we probably won't have to wait too long :)
Not working on connect either
You could base64 encode the solution
But then you still need to use parentheses to decode it
Ah sorry I meant for the spoiler. He could base64 the solution given that he doesn't know how to do spoilers on lemmy
Ah true that would have worked, figured since spoilers don't work on most apps I might as well just post them.
Gave some thoughts but couldn't find any. I need the solutions
Alright, here are my solutions :)
- Import Easter egg
import __hello__
Not the most technically interesting, but a fun Easter egg!
- Class decorators
@print
@lambda _: "Hello World"
class Foo:
...
Decorators are another way of calling a function, so can be abused to solve this task. You need to decorate a class rather than a function though, since a function definition requires parentheses!
- Dunder methods
class Printer:
__class_getitem__ = print
Printer["Hello World"]
There might be some other Dunder methods you can use to do this, although it's sort of difficult since most (e.g. __add__
) only describe behaviour on the instance of the class.
- More dunder methods
from _sitebuiltins import Quitter
Quitter.__add__ = print
exit + "Hello World"
Writing number 3 made me realise I just needed to find a class that already had an instance and change that. I'm sure there are many other cases of this, but here's one!
Very interesting solutions. I was in the direction of using dunder methods but could not figure out how. Haven't heard of the __class_getitem__
. The second solution is especially inspiring.
Python
Welcome to the Python community on the programming.dev Lemmy instance!
📅 Events
Past
November 2023
- PyCon Ireland 2023, 11-12th
- PyData Tel Aviv 2023 14th
October 2023
- PyConES Canarias 2023, 6-8th
- DjangoCon US 2023, 16-20th (!django 💬)
July 2023
- PyDelhi Meetup, 2nd
- PyCon Israel, 4-5th
- DFW Pythoneers, 6th
- Django Girls Abraka, 6-7th
- SciPy 2023 10-16th, Austin
- IndyPy, 11th
- Leipzig Python User Group, 11th
- Austin Python, 12th
- EuroPython 2023, 17-23rd
- Austin Python: Evening of Coding, 18th
- PyHEP.dev 2023 - "Python in HEP" Developer's Workshop, 25th
August 2023
- PyLadies Dublin, 15th
- EuroSciPy 2023, 14-18th
September 2023
- PyData Amsterdam, 14-16th
- PyCon UK, 22nd - 25th
🐍 Python project:
- Python
- Documentation
- News & Blog
- Python Planet blog aggregator
💓 Python Community:
- #python IRC for general questions
- #python-dev IRC for CPython developers
- PySlackers Slack channel
- Python Discord server
- Python Weekly newsletters
- Mailing lists
- Forum
✨ Python Ecosystem:
🌌 Fediverse
Communities
- #python on Mastodon
- c/django on programming.dev
- c/pythorhead on lemmy.dbzer0.com
Projects
- Pythörhead: a Python library for interacting with Lemmy
- Plemmy: a Python package for accessing the Lemmy API
- pylemmy pylemmy enables simple access to Lemmy's API with Python
- mastodon.py, a Python wrapper for the Mastodon API