On Fri, Feb 10, 2017 at 11:49 PM, eryk sun <eryk...@gmail.com> wrote: > On Sat, Feb 11, 2017 at 3:22 AM, boB Stepp <robertvst...@gmail.com> wrote: >> >> py3: help(repr) >> Help on built-in function repr in module builtins: >> >> repr(obj, /) >> Return the canonical string representation of the object. >> >> For many object types, including most builtins, eval(repr(obj)) == obj. >> >> Question: What does the forward slash represent in this context? > > It's from the function's __text_signature__. > > >>> repr.__text_signature__ > '($module, obj, /)' > > It means "obj" is a positional-only argument that cannot be passed as a > keyword.
[snip] > Look at open() for comparison. > > >>> open.__text_signature__ > "($module, /, file, mode='r', buffering=-1, encoding=None,\n > errors=None, newline=None, closefd=True, opener=None)" In your comparison example, a forward slash appears again, but this time after "$module" in the location where "obj" previously appeared in the repr example. Is it indicating a similar use here? Can you provide a link to "__text_signature__" in the docs? I tried searching for it, but came up empty. -- boB _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor