JADEx Swaps 'Immutability' for 'readonly'; Python Developers Clash Over `Optional` vs. `Union` Syntax
JADEx v0.42 replaced the term 'Immutability' with 'readonly' because the prior word caused confusion regarding whether immutability was deep or shallow. Furthermore, the scope of the `final` keyword now extends to include method parameters, making them readonly by default.
The Python types discussion is split. Some advocates demand explicit typing using `int | None` and criticize initializing typed variables directly to `None`. Over the syntax for optional types, there is a clear rift: some favor `Optional[T]`, while `logging_strict` insists on `Union[T, None]` universally because `Optional` is allegedly not a true option type. Another hot spot concerns default mutable arguments, with `Vulwsztyn` pushing for syntactic sugar to replace tiresome boilerplate code.
The consensus favors explicit declarations. Developers must move away from implicit optional states. While the structure of passing values remains murky, the technical direction points toward rigorous, explicit type handling, exemplified by needing `id(a) == id(b)` for true reference inspection, and the preference for verbose `Union` syntax over cleaner but less explicit shortcuts.
Key Points
JADEx renamed 'Immutability' to 'readonly' in v0.42
JADEx Core confirmed the change to eliminate ambiguity surrounding deep versus shallow immutability.
Explicit typing for optional variables is mandatory
The general consensus mandates using constructs like `int | None` instead of relying on implicit initialization to `None`.
Using `Union[T, None]` is superior to `Optional[T]` in type hinting
`logging_strict` argues that `Optional` fails to meet the standard requirements for true option types.
Explicit reference checking requires `id(a) == id(b)`
`logging_strict` stated that relying solely on `is` fails to capture the full mechanism needed for proper reference inspection.
Syntactic sugar is needed for default mutable arguments
`Vulwsztyn` wants to eliminate the repetitive `if to is None:` boilerplate required for defaults like lists and dicts.
Source Discussions (4)
This report was synthesized from the following Lemmy discussions, ranked by community score.