« first day (4955 days earlier)   

3:03 AM
@deostroll Parameters after “*” or “*identifier” are keyword-only parameters and may only be passed used keyword arguments. stackoverflow.com/questions/2965271/…
@KarlKnechtel Just call them 'kwargs', already. Like the doc does. Keep the name distinct to 'keyword', as Aran-Fey says.
 
@Aran-Fey if, while, for, def, import, etc are reserved words.
 
3:20 AM
@PM2Ring The doc calls them keywords, and most other languages call them keywords, so we should too. (We can also draw a distinction between actual keywords vs conventional names: 'self', 'args', 'kwargs', 'cls'...
...And then there are the conventional names and aliases for packages/modules, which it's recommended practice not to shadow: string, import numpy as np, import matplotlib.pyplot as plt,import seaborn as sns, import pandas as pd...
 
4:06 AM
@smci Yes. That's unfortunate. But it does say "reserved words, or keywords".
 
 
1 hour later…
5:10 AM
Generally programmers call them keywords. If you type help() then keyword Python lists you all 35 hard keywords. If you import keyword you can then see the 35 hard keywords inkeyword.kwlist and the 4 extra in keyword.softkwlist: _, case, match, type
155
Q: Is the list of Python reserved words and builtins available in a library?

Neil GIs the list of Python reserved words and builtins available in a library? I want to do something like: from x.y import reserved_words_and_builtins if x in reserved_words_and_builtins: x += '_'

(doesn't include builtin types, or builtin functions)
(doesn't include builtin types, or builtin functions, or builtin exceptions. Can access those with import builtins: 158 more as of 3.12)
 
5:33 AM
(and then there all the conventional names for dunder methods and dunder attributes. See simonwillison.net/2024/Mar/20/every-dunder-method-in-python )
 

« first day (4955 days earlier)