Just like code-golf, restricted-source pushes one to exploit quirks and hidden features of the Python language. We already have a place to collect all these tips for code-golf, those for restricted-source remain transmitted by word of mouth or hidden deep within the python documentation.
So today I would like to ask you what are some tips for solving restricted-source challenges in Python?
Please only include 1 tip per answer.
What makes a good tip here?
There are a couple of criteria I think a good tip should have:
It should be (somewhat) non obvious.
Similar to the code-golf tips it should be something that someone who has golfed in python a bit and read the tips page would not immediately think of. For example "Replace
a + b
witha+b
to avoid using spaces", is obvious to any golfer, since it is already a way to make your code shorter. Thus it is not a good tip here.It should not be too specific.
Since there are many different types of source restrictions, answers here should be at least somewhat applicable to multiple source restrictions, or one common source restriction. For example tips of the form How to X without using character(s) Y are generally useful since banned characters is a common source restriction. The thing your tip helps to do should also be somewhat general. For example tips of the form How to create numbers with X restriction are useful since many programs utilize numbers regardless of the challenge. Tips of the form How to implement Shor's algorithm with X restriction are basically just answers to a challenge you just invented and not very helpful to people solving other challenges.
==
and==0
with the^
and^0
operations. Does this count as a wat for doing restricted source? \$\endgroup\$