-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update docs for 0.14.2 #8
Comments
Done. Other things to mention:
|
Done. Small issues to fix:
|
A section on types has been added to Maybe add a note about type systems somewhere in the README. This three-part discussion on LtU was particularly interesting.
Taking this into a Python context, if explicit is better than implicit (ZoP §2), why not make at least some of this latent information, that must be there anyway, machine-checkable? Hence type annotations (PEP 3107, 484, 526) and mypy. Unpythonic itself will likely remain untyped indefinitely, since I don't want to enter that particular marshland with things like |
Also this information is now in More on typing:
|
Merged with the megapost below.
|
Also this is now in the section on types in
|
This is now mentioned in
|
We now provide our own flavor of Common Lisp style conditions, see
|
|
This has now been incorporated to the section on
|
This text has been incorporated into Changelog for 0.14.2 (draft; updated Nov 4, 2019)"Greenspun" edition: I think that with the arrival of conditions and restarts, it is now fair to say This release welcomes the first external contribution. Thanks to @aisha-w for the much improved organization and presentation of the documentation! Language version: Rumors of the demise of Python 3.4 support are exaggerated. While the testing of That is, support for 3.4 will likely be dropped with the arrival of the next batch of breaking changes. The current plan is visible in the roadmap as the 0.15.0 milestone. If you still use 3.4 and find something in New:
Fixed:
|
Merged with the megapost below.
|
|
Merged with reading links below. Just archiving some links to reading...
|
The 0.14.2 documentation update megapost - Updated 7 Aug, 2020 Remaining documentation TODOs for 0.14.2. Done and cancelled ones struck out.
|
An updated version of this text has been incorporated to Condition system - draft: Following Peter Seibel (Practical Common Lisp, chapter 19), we define errors as the consequences of Murphy's Law. As we already know, an exception system splits error-recovery responsibilities into two parts. In Python terms, we speak of raising and then handling an exception. The main difference is that a condition system, instead, splits error-recovery responsibilities into three parts: signaling, handling and restarting. Why would we want to do that? The answer is improved modularity. Consider separation of mechanism and policy. We can place the actual error-recovery code (the mechanism) in restarts, at the inner level (of the call stack) - which has access to all the low-level technical details that are needed to actually perform the recovery. We can provide several different canned recovery strategies - generally any appropriate ways to recover, in the context of each low- or middle-level function - and defer the decision of which one to use (the policy), to an outer level. The outer level knows the big picture - why the inner levels are running in this particular case, i.e. what we are trying to accomplish and how. Hence, it is in the ideal position to choose which error-recovery strategy is appropriate in that context. Fundamental signaling protocol Generally a condition system operates as follows. A signal is sent (outward on the call stack) from the actual location where the error was detected. A handler at any outer level may then respond to it, and execution resumes from the restart invoked by the handler. This sequence of catching a signal and invoking a restart is termed handling the signal. Handlers are searched in order from innermost to outermost on the call stack. In general, it is allowed for a handler to fall through (return normally); then the next outer handler for the same signal type gets control. This allows chaining handlers to obtain their side effects (such as logging). This is occasionally referred to as canceling, since as a result, the signal remains unhandled. Viewed with respect to the call stack, the restarts live between the (outer) level of the handler, and the (inner) level where the signal was sent from. When a restart is invoked, the call stack unwinds only partly. Only the part between the location that sent the signal, and the invoked restart, is unwound. High-level signaling protocols We actually provide four signaling protocols: If no handler handles the signal, the The The Finally, there is the If the standard protocols don't cover what you need, you can also build your own high-level protocols on top of Notes The name If you really want to emulate Conditions vs. exceptions Using the condition system essentially requires eschewing exceptions, using only restarts and handlers instead. A regular exception will fly past a Be aware that error-recovery code in a Lisp-style signal handler is of a very different nature compared to error-recovery code in an exception handler. A signal handler usually only chooses a restart and invokes it; as was explained above, the code that actually performs the error recovery (i.e. the restart) lives further in on the call stack. An exception handler, on the other hand, must respond by directly performing error recovery right where it is, without any help from inner levels - because the stack has already unwound when the exception handler gets control. Hence, the two systems are intentionally kept separate. The language discontinuity is unfortunate, but inevitable when conditions are added to a language where an error recovery culture based on the exception model (of the regular non-resumable kind) already exists. CAUTION: Make sure to never catch the internal If a handler attempts to invoke a nonexistent restart (or one that is not in the current dynamic extent), If this That should be most of the narrative. Still need to include API docs. Relevant LtU discussion. Stroustrup on why he chose in C++ not to have a resume facility.
|
Updated 17 Mar 2020 Links to relevant readings.
|
Finally, everything necessary is done. Closing. |
Document the new features in README. Mention bug fixes in changelog. See recent commits for details.
This part done. See below for any remaining points, especially the megapost and readings.
The text was updated successfully, but these errors were encountered: