|
|
Log in / Subscribe / Register

Positional-only parameters for Python

Positional-only parameters for Python

Posted Apr 10, 2019 17:57 UTC (Wed) by juliank (guest, #45896)
In reply to: Positional-only parameters for Python by dbaker
Parent article: Positional-only parameters for Python

Using _ for things to ignore is fine until you want to introduce gettext as _ :D


to post comments

Positional-only parameters for Python

Posted Apr 11, 2019 9:39 UTC (Thu) by mgedmin (guest, #34497) [Link]

And for extra fun, _ has a special meaning in the REPL (it contains the value of the last expression).

$ python3
Python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 2 + 2
4
>>> print("hi")
hi
>>> _
4

Positional-only parameters for Python

Posted Apr 12, 2019 20:41 UTC (Fri) by dbaker (guest, #89236) [Link]

Which is just so weird to me :)


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds