Skip to content

Infer calls to str.format() on names #1611

@jacobtylerwalls

Description

@jacobtylerwalls

Future enhancement could infer this value instead of giving an empty string:

from astroid import extract_node
call = extract_node("""
x = 'python is {}'
x.format('helpful sometimes')
""")
call.inferred()[0].value  # gives ""

Originally posted by @jacobtylerwalls in #1602 (comment)

Metadata

Metadata

Assignees

Labels

Enhancement ✨Improvement to a componentHelp wanted 🙏Outside help would be appreciated, good for new contributors

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions