About 947,000 results
Open links in new tab
  1. What exactly is metaprogramming? - Stack Overflow

    Is metaprogramming the ability to generate code on the fly or is it the ability to inject methods and attributes into existing objects at runtime (like what some dynamic languages like Python, Ruby, and …

  2. oop - What are metaclasses in Python? - Stack Overflow

    True You see where we are going: in Python, classes are objects, and you can create a class on the fly, dynamically. This is what Python does when you use the keyword class, and it does so by using a …

  3. metaprogramming - Python Typing: Put Constraint on Annotated

    Mar 18, 2025 · I would like to do some meta-programming with python type annotations. I want to define a certain type of Annotated, constraining the type for the metadata of the Annotated special form. For …

  4. Python metaprogramming: generate a function signature with type ...

    May 17, 2018 · The abstract syntax itself might change with each Python release So my question is: What (if any) is a reasonable way to generate a function with Python 3 type annotation based on a …

  5. Python metaprogramming, dynamic types, and static type checking

    Apr 5, 2024 · Python metaprogramming, dynamic types, and static type checking Asked 1 year, 3 months ago Modified 1 year, 3 months ago Viewed 193 times

  6. python - assign value to a variable using eval in a metaprogramming ...

    Python's eval function evaluates expressions. It doesn't execute statements. Assignment is a statement, not an expression. That explains the problem you're having. In general. making a global change …

  7. metaprogramming - How to dynamically create type annotations in …

    Jul 3, 2024 · How to dynamically create type annotations in Python? Asked 1 year, 5 months ago Modified 1 year, 5 months ago Viewed 1k times

  8. Metaprogramming in Python - adding an object method

    6 I've got a background in Python (though entirely self-taught, so I might have some bad habits or misconceptions), and I'm trying to learn Ruby to broaden my scope. I was reading through some …

  9. metaprogramming - How can I make all attributes in a Python …

    Sep 1, 2025 · How can I make all attributes in a Python dataclass optional without rewriting each one? Asked 3 months ago Modified 3 months ago Viewed 216 times

  10. metaprogramming - Create python class with type annotations ...

    Feb 18, 2023 · Create python class with type annotations programatically Asked 2 years, 10 months ago Modified 1 year, 4 months ago Viewed 2k times