I scarcely know Python, and I have no intention delving into it further.
 I was forced to use Python because it features binary decision diagrams, which 
MATHEMATICA doesn't. Coming from Mathematica the account of Nathan Murphy reads 
like a nightmare.

The one point that stroke me the most was the schism between Python 2 and 3. No 
such thing with Mathematica: All its 11 or more versions are fully compatible, 
I never experienced any problems in this regard.

Another point is the bad online help provided to "teach yourself" Python. For 
instance, it took me more than an hour to find out how to negate a Boolean 
variable, whereas in Mathematica you would just type "Negation" in the Wolfram 
Documentation search window, and get the information you need.

I know one pays for Mathematica whereas Python is open source, but I've come to 
realize now that this money is very well spent!

Question: Apart from a few commands not available in Mathematica, such as 
expr2bdd, is there really any domain of computation where Mathematica is 
inferior to Python?

Marcel

-----Original Message-----
From: Python-list [mailto:python-list-bounces+mwild=sun.ac...@python.org] On 
Behalf Of bartc
Sent: 19 February 2018 02:35 PM
To: python-list@python.org
Subject: Re: Are the critiques in "All the things I hate about Python" valid?

On 19/02/2018 02:59, Chris Angelico wrote:
> On Mon, Feb 19, 2018 at 1:14 PM, bartc <b...@freeuk.com> wrote:

>> How would even a type for the odd numbers from 1 to 10 inclusive work?
>> (That, a type consisting of one of the values in {1,3,5,7,9}.) Would
>> they be ordered or unordered? Can I do arithmetic with them: will 3*3
>> work, but not 3*5?
>
> The type is "positive odd number below ten" and could be written as
> int(1..9|1%2). That is an orderable type; you can say that 3 < 7, for
> instance. And yes, arithmetic would be defined just fine;

Sometimes, the reason for creating a special numerical type is precisely so you 
can't do arithmetic on them, if it's not meaningful for the type.

So the special type of the values 65..90 might not allow the type be multiplied 
or divided, or added to itself. Because they represent characters A..Z. Or 
house numbers. Or the age of pensioners. (You'd need to convert to ordinary 
integers, is that is allowed.)

  there's no
> requirement for the result of an operation to have the same type as
> its inputs:

>
>>>> 5 / 2 # two integers
> 2.5

Try that when the type of {1..13} represents playing card ordinal values.

Type systems get rapidly very complicated when you have to deal with arbitrary 
sets of values and with arbitrary rules of interaction.
Someone has to devise a programming language to allow all that without tying 
itself up in knots. Someone else has to program in it. And someone else has to 
try and understand it!

Ones like C++ has already tied itself itself up in knots just doing the basics; 
I'm not sure how it would handle even my 1,3,5,7,9 type.

But Python has classes and can do some of this stuff; how would it handle a 
numeric type that is constrained to be whole numbers within
0..9 inclusive?

--
bartc
--
https://mail.python.org/mailman/listinfo/python-list
The integrity and confidentiality of this email is governed by these terms / 
Die integriteit en vertroulikheid van hierdie e-pos word deur die volgende 
bepalings gereƫl. http://www.sun.ac.za/emaildisclaimer
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to