Python Forum
Inconsistency in Python programming language?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Inconsistency in Python programming language?
#7
(Oct-04-2019, 07:24 AM)DeaD_EyE Wrote: Use one week JavaScript and you'll love the type safety in Python.

(Oct-04-2019, 12:07 PM)jefsummers Wrote: In other languages casting may be an assertion where conversion takes action. In those cases casting an object to a more specific object gives you the ability to act on it differently, but does not necessarily result in a conversion of that object to the more specific object.
Sorry, I'm a newbie at Python. I'm afraid I have no further knowledge about other programming languages than when I look for some doubts in Python, and I find that in some cases, they explain how the same is done in Java or in C. While at times I can guess the similarities and differences, in a similar way as I can somewhat manage to change a program written in Python 2 into Python 3, without having studied Python 2, I couldn't do much more than that.

(Oct-04-2019, 02:55 PM)adt Wrote: The following approach could cover all cases (e.g where we might not be sure whether the input string has decimal):

int(float("4.5"))
Output:
4
I like that, although of course it is just a way to bypass the problem, and not a direct approach to handle what it seems a contradiction and an inconsistency. I guess it is something that only people belonging to the Python Software Foundation could address in the case they were inclined to ...

Thank you everyone for your insights!!!

All the best,
newbieAuggie2019

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Reply


Messages In This Thread
RE: Inconsistency in Python programming language? - by newbieAuggie2019 - Oct-04-2019, 03:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Programming robots using Python OscarBoots 5 3,525 Oct-31-2021, 09:38 AM
Last Post: Larz60+
  logo language code into python aayushi98 2 72,795 Jan-26-2021, 09:02 PM
Last Post: Serafim
  Programming Difficult math in Python Huntern 6 4,864 Oct-17-2019, 06:32 AM
Last Post: Huntern
  Terms describing Python Programming language leodavinci1990 3 2,780 Aug-12-2019, 02:48 PM
Last Post: leodavinci1990
  Please help a newbie choose which programming language to learn. yeto 2 3,571 Feb-25-2019, 12:56 AM
Last Post: yeto
  Python Programming Projects for Beginners jack_sparrow007 3 3,369 Dec-26-2018, 07:52 PM
Last Post: micseydel
  How to get image from WolframAlpha by using Python language manhnt 1 2,728 Oct-27-2018, 02:07 PM
Last Post: Larz60+
  Programming Python as a MS Windows app? Brian123 8 4,364 Oct-17-2018, 10:26 PM
Last Post: Brian123
  Help with Python programming mediaos 5 3,828 Aug-08-2018, 01:02 PM
Last Post: Larz60+
  How to make the python default language be 3.6 instead of 2.7 sylas 4 6,875 Jul-06-2018, 06:11 AM
Last Post: sylas

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020