On Sat, Sep 29, 2018 at 10:05:39PM +0300, Serhiy Storchaka wrote: > 29.09.18 21:38, Steve Barnes пише:
[...] > >>Why do you convert to int when you need a string representation? Just > >>print(float('nan')). > >> > >>I converted to int because I needed a whole number, this was intended to > >represent some more complex process where a value is converted to a > >whole number down in the depths of the processing. > > float('nan') is a number (in Python sense). No need to convert it. Steve just told you that he doesn't need a number, he needs a whole number (an integer), and that this represents a more complex process that includes a call to int. Why do you dismiss that and say there is no need to call int when you don't know the process involved? It *may* be that Steve could use math.floor() or math.ceil() instead, neither of which have the same meaning as calling int(). But more likely he DOES need to convert it by calling int, just as he says. Telling people that they don't understand their own code when you don't know their code is not very productive. -- Steve _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/