PEP 736: Keyword Argument Shorthand: Final Draft

As mentioned in my post in the other thread, we can use a dunder keyword instead of a symbol to make the code look less cryptic/more Pythonic, at the cost of brevity:

my_function(
    my_first_variable=__same__,
    my_second_variable=__same__,
    my_third_variable=__same__
)

This has now evolved into a possible keyword __target_text__ per our discussion in that thread:

MyTuple = namedtuple(__target_text__, "a b c")
1 Like