About 1,010,000 results
Open links in new tab
  1. string - Typecasting in Python - Stack Overflow

    May 1, 2016 · I need to convert strings in Python to other types such as unsigned and signed 8, 16, 32, and 64 bit ints, doubles, floats, and strings. How can I do this?

  2. types - What does typing.cast do in Python? - Stack Overflow

    Jul 21, 2018 · import typing type (typing.cast (int, '11')) still returns <class 'str'> instead of int. Then, what does typing.cast do here?

  3. inheritance - How to cast object in Python - Stack Overflow

    Feb 2, 2012 · How to cast object in Python Asked 13 years, 10 months ago Modified 5 years, 2 months ago Viewed 140k times

  4. Safe casting in python - Stack Overflow

    Safe casting in python Asked 14 years, 5 months ago Modified 5 years, 10 months ago Viewed 63k times

  5. Automatically Type Cast Parameters In Python - Stack Overflow

    Oct 1, 2015 · Background: I mostly run python scripts from the command line in pipelines and so my arguments are always strings that need to be type casted to the appropriate type. I make a …

  6. casting - Arbitrary type conversion in python - Stack Overflow

    May 12, 2022 · An arbitrary typecasting function (shown below as cast) seems like a fairly straightforward function: print (type (variable)) variable = cast (variable,type) # where type is …

  7. Dynamic type casting in python - Stack Overflow

    Jul 12, 2012 · Pydantic is the answer for dynamic type conversion. If type of values of is going to be a reference for the type of values in , it's generally a good idea to convert dicts1 into a class …

  8. In python, how do I cast a class object to a dict - Stack Overflow

    Feb 9, 2016 · I don't think simply making the class iterable will solve the problem. I also attempted many googles with as many different wordings of "python cast object to dict" as I could think of …

  9. python - Convert a str to path type? - Stack Overflow

    Jul 22, 2021 · What is path.path? Sounds like a class that is defined by the code you are using; it's not a standard type or class. Prior to Python 3.4, there was no standard for paths; functions …

  10. file io - type casting in python error handling - Stack Overflow

    Apr 12, 2012 · type casting in python error handling Asked 13 years, 7 months ago Modified 13 years, 7 months ago Viewed 13k times