Mastery

Concept map

How these ideas connect

Curated relationships between topics — solid lines connect ideas within a language that build on each other, dashed teal lines cross to the genuinely equivalent concept in the other language. Hover a dot for its title, click to open the topic.

PythonJavaA. Object model, identity & memoryB. Iteration & generatorsC. Functions & closuresD. Classes & OOP internalsE. Typing & modern syntaxF. Concurrency & parallelismG. Error handlingH. Imports & packagingJ. Stdlib gemsA. Object model, identity & memoryB. GenericsC. Collections frameworkD. Streams & functional interfacesE. ConcurrencyF. ExceptionsG. Modern language features (8 → 21)I. Modules & misc stdlib`is` vs `==`, the small-int cache, and string interning`is` vs `==`, the s…The mutable default argument trapThe mutable default…Shallow vs deep copyShallow vs deep copy`__slots__`: memory savings, what you lose`__slots__`: memory…Reference counting + generational cyclic GCReference counting …Weak referencesWeak referencesdict/set size cannot change during iterationdict/set size canno…The iterator protocol: why `for` calls `iter()` exactly onceThe iterator protoc…Generators: lazy, one-shot, and why they save memoryGenerators: lazy, o…`yield from`, delegation, and generator `send()`/`throw()`/`close()``yield from`, deleg…`itertools` deep-dive`itertools` deep-di…PEP 479: `StopIteration` raised *inside* a generator becomes `RuntimeError`PEP 479: `StopItera…Late-binding closures: the classic loop-variable-capture bugLate-binding closur…Positional-only (`/`) and keyword-only (`*`) parametersPositional-only (`/…`*args`/`**kwargs`: collection vs unpacking, and ordering rules`*args`/`**kwargs`:…Decorators silently destroy metadata unless you use `functools.wraps`Decorators silently…`@property`, `@staticmethod`, `@classmethod` -- and the descriptor protocol underneath`@property`, `@stat…The `__eq__`/`__hash__` contractThe `__eq__`/`__has…`__repr__` vs `__str__`, and why every class should define `__repr__``__repr__` vs `__st…Context managers: `__enter__`/`__exit__`, `contextlib.contextmanager`, `ExitStack`Context managers: `…Dataclasses: `field(default_factory=...)`, `__post_init__`, `frozen=True`, generated `__eq__`Dataclasses: `field…The walrus operator `:=`The walrus operator…`match`/`case` structural pattern matching (PEP 634)`match`/`case` stru…f-string `=` debug specifier and the format-spec mini-languagef-string `=` debug …What the GIL actually protects (and what it doesn't)What the GIL actual…threading vs multiprocessing vs asyncio -- when each one actually helpsthreading vs multip…Exception chaining: `raise X from Y`, `__cause__` vs. implicit `__context__`Exception chaining:…`try`/`except`/`else`/`finally` -- what `else` is actually for`try`/`except`/`els…`sys.modules` as the import cache, and why circular imports fail the way they do`sys.modules` as th…`collections`: `Counter`, `defaultdict`, `deque`, `ChainMap``collections`: `Cou…`enum`: `auto()`, `Flag` (bitwise combos), `StrEnum`/`IntEnum``enum`: `auto()`, `…`==` vs `.equals()`, and the String constant pool`==` vs `.equals()`…The `Integer` autobox cache (-128..127)The `Integer` autob…The `hashCode`/`equals` contractThe `hashCode`/`equ…Records: compact constructors, generated equals/hashCode/toStringRecords: compact co…`final` vs. true immutability, "effectively final" for lambda capture`final` vs. true im…Defensive copying, and why returning internal mutable state directly is a real bugDefensive copying, …Generics are erased at runtimeGenerics are erased…Bounded wildcards and PECS ("Producer Extends, Consumer Super")Bounded wildcards a…Unchecked warnings and heap pollution with varargs + genericsUnchecked warnings …`List.of()` / `Map.of()` are truly immutable`List.of()` / `Map.…Fail-fast iterators: `ConcurrentModificationException` — and when it DOESN'T fireFail-fast iterators…`Comparable` vs `Comparator``Comparable` vs `Co…`HashMap` vs `LinkedHashMap` vs `TreeMap` ordering guarantees`HashMap` vs `Linke…`Collectors`: `groupingBy`, `partitioningBy`, `teeing`, `toUnmodifiableList``Collectors`: `grou…Streams are lazy: nothing runs until a terminal operationStreams are lazy: n…`Optional`: `orElse` (always evaluated) vs `orElseGet` (lazy)`Optional`: `orElse…Method references: all four kindsMethod references: …Functional interface composition: `andThen`/`compose`, `and`/`or`/`negate`Functional interfac…Parallel streams: the common `ForkJoinPool`, when it helps, ordering pitfallsParallel streams: t…`synchronized` and `volatile`: visibility vs. atomicity -- two different problems`synchronized` and …Virtual threads (Project Loom, Java 21) vs. platform threadsVirtual threads (Pr…`CompletableFuture` chaining: `thenApply`/`thenCompose`/`thenCombine`, sync vs. async`CompletableFuture`…`ThreadLocal` and the classic thread-pool memory leak`ThreadLocal` and t…Atomic classes (`AtomicInteger`, CAS) vs `synchronized` for simple countersAtomic classes (`At…Checked vs. unchecked exceptions -- the actual compiler-enforced differenceChecked vs. uncheck…try-with-resources, `AutoCloseable`, and suppressed exceptionstry-with-resources,…`finally` silently swallowing a `return`/exception from `try``finally` silently …`var` local type inference (Java 10+)`var` local type in…Switch expressions + pattern matching for switch + `sealed`, working togetherSwitch expressions …Text blocks (`"""`, Java 15+)Text blocks (`"""`,…`java.time` vs. legacy `Date`/`Calendar``java.time` vs. leg…
T1 topic T2 topic T3 topic builds on Python ↔ Java equivalent