@Paddy3118
A Python programmer and Rosetta Code contributor
(As tag)
(What kind of site is this)?
No blogs yet.
You stated: To add a hash method, you need to make them immutable by setting unsafe_hash to True The logic doesn't seem to fit the naming, and from how I interpret the docs you might do it this way but it is frowned on: Although not recommended, you can force dataclass() to create a hash () method with unsafe_hash=True. This might be the case if your class is logically immutable but can nonetheless be mutated. This is a specialized use case and should be considered carefully. It might be better to look at the settings of the eq and frozen parameters when unsafe_hash=False , (the default): Setting eq=True, frozen=True would then get a hash method generated. Gosh, it takes my concentration to work this out :-)
The use of the ellipses as a function body placeholder was new to me and seems very readable. Thanks for that. One slight niggle was in your use of 'l' as a name; You might try avoiding the use of 'l', el and 'o' oh in names as certain fonts make them hard to distinguish from one and zero. A useful post, thanks :-)
6} Choose correct Data Types If you restrict something then check that the value is within the assumed range. Many exploits might take advantage of giving values outside what was once thought a reasonable range. As an aside, arbitrary string length in dynamic languages such as Perl can often help.
For example, canScrollHorizontally is so much better and meaningful than ScrollableX. Context is everything. If the variable is defined in a scollability method or class, then a better name might be 'allowHorizontal' or allowHoriz or even allowH. You have to balance identifier length, and a good way of accomplishing that is to make use of context .
A long running project wanted a little flexibility in their compile script so added conditionals; then variables, statements,... No documentation except the awful sources. No tests except "it used to work". If tempted to write your own language, then fine - just don't let it escape into the real world without the docs, tests, support,...