x = getattr(self, source)
will work just perfectly if source
names ANY attribute of self, including the other_data
in your example.
More Related Contents:
- The letter ‘n’ is invalid syntax in Python? [closed]
- Is there a way to declare all the values in the list as a list individually in python [closed]
- What does ** (double star/asterisk) and * (star/asterisk) do for parameters?
- What does the star and doublestar operator mean in a function call?
- What is the difference between ‘/’ and ‘//’ when used for division?
- What is the result of % in Python?
- Accessing dict keys like an attribute?
- Why does adding a trailing comma after a variable name make it a tuple?
- What does “while True” mean in Python?
- Why are trailing commas allowed in a list?
- When are parentheses required around a tuple?
- Python Script returns unintended “None” after execution of a function [duplicate]
- Python “raise from” usage
- What does [:] mean?
- What does ‘wb’ mean in this code, using Python?
- Is it possible to get a list of keywords in Python?
- Is there a difference between continue and pass in a for loop in Python?
- How do you express binary literals in Python?
- Why does python use two underscores for certain things?
- What is the purpose of the colon before a block in Python?
- Python print statement “Syntax Error: invalid syntax” [duplicate]
- The difference between double brace `[[…]]` and single brace `[..]` indexing in Pandas
- How to include a double-quote and/or single-quote character in a raw Python string literal?
- What do ** (double star/asterisk) and * (star/asterisk) mean in a function call?
- How to tell if a string contains valid Python code
- What does the ** maths operator do in Python?
- str.format() raises KeyError
- Square braces not required in list comprehensions when used in a function
- How can I diagnose common errors in JSON data?
- How do I get a decimal value when using the division operator in Python?