Python Forum
i can use this statement as a variable name
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i can use this statement as a variable name
#1
there is such a thing as an async statement. yet i can use async as a variable name. it is not a reserved word. how does that work?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
it will only work until you try to use the real async in the same scope
Reply
#3
Currently, it appears there are only 35 words you can't use as variable names. But, as Larz points out, that doesn't mean it's necessarily a good idea to use all the other words as variable names.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#4
is there a list of all the other words that is a good idea to avoid?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#5
All the built-ins and all the standard modules?
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#6
just those and no more? can i use async?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#7
Just an FYI, a good IDE, such as VSCode will highlight 'reserved words' (old school).
It doesn't prevent you from using them, but makes you aware of the danger involved.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  An IF statement with a List variable dedesssse 3 8,345 Jul-08-2021, 05:58 PM
Last Post: perfringo
  define a variable using an if statement Margaridalopes 2 2,200 Oct-24-2020, 05:47 PM
Last Post: jefsummers
  How to store the value from variable into list & run a statement then put in variable searching1 1 2,474 May-29-2019, 06:36 AM
Last Post: heiner55
  SELECT statement query question using a variable DT2000 2 3,050 Feb-23-2019, 07:35 AM
Last Post: DT2000
  Invalid syntax in two variable if statement? 00712411 1 2,287 Oct-10-2018, 12:36 AM
Last Post: stullis
  If statement variable not defined MTom5 3 6,784 Sep-03-2018, 04:31 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020