Re: [Python-ideas] Simplicity of C (was why is design-by-contracts not widely)

2018-09-28 Thread Hugh Fisher
gt; > On Tue, Sep 25, 2018 at 09:59:53PM +1000, Hugh Fisher wrote: > > > C and Python (currently) are known as simple languages. > > o_O > > That's a usage of "simple" I haven't come across before. Especially in > the case of C, which is a minefield of *

Re: [Python-ideas] Why is design-by-contracts not widely

2018-09-25 Thread Hugh Fisher
th infinite resources contracts could be added to those Python packages, or everything in PyPi, and it would be an improvement. But we don't. So I'd like to see the developers of numpy etc keep doing whatever it is that they're doing now. -- cheers, Hugh Fisher

[Python-ideas] Why is design-by-contracts not widely adopted?

2018-09-25 Thread Hugh Fisher
ular, contracts in Eiffel don't explain *why* they're there. As for 4) reading the code, why not? "Use the source, Luke" is now a programming cliche because it works. It's particularly appropriate for Python packages which are usually distributed in source form and

Re: [Python-ideas] Why is design-by-contracts not widely adopted?

2018-09-23 Thread Hugh Fisher
Or is this an updated version of the old saying "real programmers write FORTRAN in any language" ? If you are accustomed to Design by Contract, think of your time in the Python world as a trip to another country. Relax and try to program like the locals do. You might enjoy it. --

Re: [Python-ideas] Pre-conditions and post-conditions

2018-08-29 Thread Hugh Fisher
the post conditions and/or invariants restored. So there's more syntax for "rescue" and "retry" If you want to do simple pre and post conditions, Python already has assert. If you want to go full design by contract, there's no law saying that Python is the only progra

Re: [Python-ideas] A GUI for beginners and experts alike (Mike Barnett)

2018-08-23 Thread Hugh Fisher
; in QT is only half a dozen or less lines of code in total, so meets the simplicity requirement. The big drawback of QT for Python until now has been building the thing, but now it's on PyPI so "pip install" (should) Just Work. -- cheers, Hugh Fisher ___

Re: [Python-ideas] Trigonometry in degrees

2018-06-08 Thread Hugh Fisher
i, Jun 08, 2018 at 08:17:02AM +1000, Hugh Fisher wrote: > >> But I think that the use of >> radians in programming language APIs is more prevalent, so the initial >> advantage >> of easy learning will be outweighed by the long term inconvenience of >> adjusting to w

Re: [Python-ideas] Trigonometry in degrees

2018-06-07 Thread Hugh Fisher
> import to know if it's in degrees or radians (and that leads to very filthy > bugs). Also "degrees" is already so the name would have to change the name of > the package. Agree, not a good idea. -- cheers, Hugh Fisher ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Should Python have user-defined constants?

2017-11-21 Thread Hugh Fisher
al to how Python works, and also the source of so much power and flexibility, that I think it is worth living with the occasional glitch. I would not want to see Python allow module or class writers to declare "my code is perfect and not to be changed". But I would not mind if I could write c

[Python-ideas] Tighten up the formal grammar and parsing a bit?

2017-05-15 Thread Hugh Fisher
print(x) if x == 2: x += 1 ;"Add 1 to x" print(x) if x == 3: 42 print("Answered everything") if __name__ == "__main__": helloWorld() print(empty()) -- cheers, Hugh Fisher __

Re: [Python-ideas] Typecheckers: there can be only one

2016-09-09 Thread Hugh Fisher
other people have made theirs, so I'll shut up now. Thanks to everyone who responded. -- cheers, Hugh Fisher ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Typecheckers: there can be only one

2016-09-08 Thread Hugh Fisher
erpreter: >>> def foo(x:itn): >>> ... return x and the interpreter raises a NameError because 'itn' is not defined. Annotations look like code, they're mixed in with names and operators and literals and keywords, and all the standard syntax and semantic

Re: [Python-ideas] Typecheckers: there can be only one

2016-09-07 Thread Hugh Fisher
ritten, either makes sense. What I would not expect is for the interpreter to silently assign a scalar 1.0 to c and continue. That's just ... WTF? Type annotations are code, not tests. -- cheers, Hugh Fisher ___ Pytho

[Python-ideas] Typecheckers: there can be only one

2016-09-07 Thread Hugh Fisher
kers themselves have versions? When a dev team uses one type checker for 1.x and then switches to another for 2.x? That's a special circle of hell. -- cheers, Hugh Fisher ___ Python-ideas mailing list Python-ideas@python.org