Skip to content

Document inheritance, encapsulation, abstraction, and async/await - #12

Open
Almas-Ali wants to merge 3 commits into
masterfrom
docs/inheritance-encapsulation-abstraction-async
Open

Almas-Ali wants to merge 3 commits into
masterfrom
docs/inheritance-encapsulation-abstraction-async

Conversation

@Almas-Ali

Copy link
Copy Markdown
Member

Summary

Three commits, grouped by feature:

  1. Inheritance, access modifiers, abstract classes — covers radon#219 and radon#220, both already merged. New sections in classes.md: super(), multiple/multilevel/hybrid inheritance and a note on C3-linearized MRO, enforced public/private/protected (including the RuntimeError they raise), and abstract class/abstract methods.
  2. Async/await and concurrency guide — covers radon#222, currently open, not yet merged to radon's master. Short intros in functions.md/built-in-functions.md, plus a full new async.md page (added to nav) covering spawn()/sleep()/gather(), a worked sequential-vs-concurrent timing example, and the closure-capture pitfall you can hit building tasks inside a for loop.
  3. Misc accuracy fixes found while auditing the last few months of merged PRs against the docs — del on a hashmap key wasn't documented (only the array case was), and two existing examples claimed the wrong hashmap print() quoting.

Verification

Every code snippet across all three commits was run against the actual radon interpreter to confirm its claimed output before being committed — including the two inaccuracies in commit 3, which were caught this way. Site builds clean under mkdocs build --strict.

One thing to flag before merging

Commit 2 (async/await) documents radon#222, which is still open. If this PR merges before that one, the live docs site will describe a language feature that isn't in a released Radon build yet. Options:

  • Hold this PR (or just commit 2) until radon#222 merges
  • Merge as-is if documenting upcoming/in-review behavior is fine for this project
  • I can split commit 2 into its own PR if you'd rather decouple it from the other two, which are safe to ship immediately

Covers the OOP features merged in radon PRs #219 (inheritance, super(),
C3 MRO) and #220 (enforced public/private/protected access modifiers,
abstract classes/methods) -- new sections in classes.md, plus a landing
page feature-list mention. Every code example was run against the actual
interpreter to verify its claimed output.
Covers async fun/await, spawn()/sleep()/gather() from radon PR #222
(async/await support, currently in review -- not yet merged to radon's
master): short intros in functions.md and built-in-functions.md, and a
full guide on a new async.md page (nav entry added to mkdocs.yml)
covering the closure-capture pitfall in loops and a worked
sequential-vs-concurrent timing example. Every code example was run
against the actual interpreter to verify its claimed output.
…keys

Found while auditing recent merged PRs against the docs (nothing else
was missing -- __destructor__, del, HashMap/array unpacking, static
methods, and the objective-method-syntax migration were all already
covered accurately):

- del on a hashmap key (del hm["key"]) works but wasn't shown, only the
  array-index case was.
- Two existing examples claimed hashmap print output with double-quoted
  keys ({"color": "red", ...}); the interpreter actually prints
  single-quoted keys ({'color': "red", ...}), verified by running both
  snippets directly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant