They were explicitly removed in the January 2021 edition.
Blame this issue: Remove or disable code snippets
All the old python snippets are here: https://github.com/microsoft/vscode-python/blob/2020.12.424452561/snippets/python.json
If you want them back:
- In vscode, File -> Preferences -> Configure User Snippets.
Type
python and choose python. A json file will open
- Copy-paste all or the specific snippets you want in the file and save
- Ctrl+Shift+P then
Reload Window to activate the changes
This is the default main snippet:
"if(main)": {
"prefix": "__main__",
"body": ["if __name__ == \"__main__\":", " ${1:pass}"],
"description": "Code snippet for a `if __name__ == \"__main__\": ...` block"
},
If you want to change or tweak which text triggers the snippet, modify the prefix field. The prefix field can be a string as shown above or a list if you want more triggers:
"prefix": ["__main__", "ifmain", "main", "ifm", "if m"],
mainand then hit tab, maybe it'd be the same in VS Code? Just a shot in the dark.