# Python 3.13 introduced:# 1. Experimental JIT compiler (--enable-experimental-jit)# 2. Free-threaded mode (no GIL) via python3.13t# 3. Improved error messages with colorimport sys
print(f"Python {sys.version}")
# Check if GIL is disabled (3.13+)# sys._is_gil_enabled() # returns False in free-threaded build
Note Python 3.13's free-threaded build removes the GIL experimentally. Most C extensions need updating to work without the GIL. The JIT is opt-in and best for CPU-bound loops.
JS: const re = new RegExp(pattern, flags)
Python: re.compile(pattern, flags)
example
JS: const dateRe = new RegExp('\\d{4}-\\d{2}-\\d{2}', 'g');
dateRe.test('2026-04-04');
Py: date_re = re.compile(r'\d{4}-\d{2}-\d{2}')
date_re.findall('2026-04-04 and 2025-12-25')
output
JS: true
Py: ['2026-04-04', '2025-12-25']
Note Compiling is beneficial when the same pattern is used repeatedly (e.g., in a loop). Python caches the most recent patterns automatically, but explicit compilation is clearer and avoids cache eviction. In JS, the RegExp constructor requires double-escaping backslashes in string form.
-- Often slow (index may not be used):
WHERE city = 'Seattle' OR state = 'WA'-- Faster alternative:
SELECT ... WHERE city = 'Seattle'
UNION
SELECT ... WHERE state = 'WA';
example
-- May not use either index effectively:
SELECT * FROM users
WHERE email = '[email protected]'
OR phone = '2065551234';
-- Better with UNION (each query uses its own index):
SELECT * FROM users WHERE email = '[email protected]'
UNION
SELECT * FROM users WHERE phone = '2065551234';
output
-- UNION lets each branch use its optimal index
Note OR conditions on different columns often prevent the optimizer from using indexes efficiently. Rewriting as UNION (or UNION ALL if you know there are no duplicates) lets each branch use its own index. Check with EXPLAIN to verify.