About 105,000 results
Open links in new tab
  1. How can I determine a Python variable's type? - Stack Overflow

    In Python code, this shouldn't make a bit of difference because the interpreter automatically converts to long when a number is too large. If you want to know about the actual data types …

  2. python - Viewing all defined variables - Stack Overflow

    Mar 11, 2009 · You do get a list of the variables, which answers the question, but with incorrect types listed beside them. This was not obvious in your example because all the variables …

  3. python - Immutable vs Mutable types - Stack Overflow

    Nov 9, 2011 · Mutable types can be changed in place. Immutable types can not change in place. That's the way python sees the world. It is regardless of how variables are passed to functions.

  4. python - How can I print multiple things (fixed text and/or variable ...

    See also: How can I print multiple things on the same line, one at a time? ; How do I put a variable’s value inside a string (interpolate it into the string)?

  5. How to force/ensure class attributes are a specific type?

    Mar 29, 2020 · In Python, primitive data types (int, float, str, booleans) are themselves classes. Thus if you instantiate the class attributes of your class before passing the method parameters …

  6. How to declare variable type, C style in Python - Stack Overflow

    Oct 14, 2010 · In Python, objects exist out there in the interpreter's memory jungle, and you can give them names and remember where to find them using variables. Your variable doesn't …

  7. How to specify multiple types using type-hints - Stack Overflow

    723 I have a function in python that can either return a bool or a list. Is there a way to specify the types using type hints? For example, is this the correct way to do it?

  8. strong typing - Is Python strongly typed? - Stack Overflow

    Jul 4, 2012 · Python is strongly, dynamically typed. Strong typing means that the type of a value doesn't change in unexpected ways. A string containing only digits doesn't magically become …

  9. python - What are variable annotations? - Stack Overflow

    140 Python 3.6 is about to be released. PEP 494 -- Python 3.6 Release Schedule mentions the end of December, so I went through What's New in Python 3.6 to see they mention the …

  10. How to compare type of an object in Python? - Stack Overflow

    For what it's worth, isinstance () is the preferred way of checking types in Python (when you have to do it).