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

    Python doesn't have such types as you describe. There are two types used to represent integral values: int, which corresponds to platform's int type in C, and long, which is an arbitrary …

  2. Get a list of all the encodings Python can encode to

    Nov 13, 2009 · I am writing a script that will try encoding bytes into many different encodings in Python 2.6. Is there some way to get a list of available encodings that I can iterate over?

  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 - Pandas Merging 101 - Stack Overflow

    Dec 6, 2018 · This post aims to give readers a primer on SQL-flavored merging with Pandas, how to use it, and when not to use it. In particular, here's what this post will go through: The basics - …

  5. python - How should I use the Optional type hint? - Stack Overflow

    Side note: Unless your code only has to support Python 3.9 or newer, you want to avoid using the standard library container types in type hinting, as you can't say anything about what types they …

  6. python - How to use typing.Annotated - Stack Overflow

    Apr 17, 2022 · 175 Annotated in python allows developers to declare the type of a reference and provide additional information related to it.

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

    Sep 20, 2025 · 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? def foo (id) -> …

  8. types - How do you set a conditional in python based on datatypes ...

    I know you can check datatypes in python, but how can you set a conditional based on the datatype? For instance, if I have to write a code that sorts through a dictionary/list and adds up …

  9. What are Python's type "objects" exactly? - Stack Overflow

    Apr 21, 2014 · Python types are ordinary objects just like anything else (everything is an object). Being a type or an instance is a matter of the object's semantics, a role that it plays.

  10. python - Determine the type of an object? - Stack Overflow

    Feb 9, 2010 · There are two built-in functions that help you identify the type of an object. You can use type() if you need the exact type of an object, and isinstance() to check an object’s type …