1

I have noticed a little curiosity in VS Code with a Python script I am writing:

I have some function that returns a numpy matrix B along with a list of parameters called parameters. In the editor, the blue hue of B is a slightly darker color than the one for parameters. This also happens for all caps variable names, like ABC, but not when starting with a capital letters and then switching to lowercase, or for a single character lowercase variable name like b.

Here are some screenshots:

original

all caps

one letter, lowercase

Capital starting letter

Zooming in on this screenshot confirms that the colors are slightly different (''dark'' blue is #44c1ff with a #1e59c5 shadow, while the lighter blue is #7cdcf0 with a #1e1ea7 shadow).

My question is: is VS Code trying to tell me something with this slight color discrepancy? Am I violating some variable naming guidelines unknowingly?

What I tried: Changed variable names around, got different color hues, code executes the same regardless of color.

0

1 Answer 1

4

PEP-8 specifies these relevant naming conventions:

  • lowercase for variable names
  • CapWords for class names
  • UPPERCASE for constants

VS Code is highlighting constants differently.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.