Skip to content

Commit 31cba1c

Browse files
committed
Updated lists in examples to reflect new alphabetization, changed last example from set to list
1 parent ba3e8ea commit 31cba1c

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

programming-languages/docs/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import programming_languages
2929
py_lang_data = programming_languages['Python']
3030

3131
print(py_lang_data['type']) # => 'programming'
32-
print(py_lang_data['extensions']) # => ['.py', '.cgi', '.fcgi', ...]
32+
print(py_lang_data['extensions']) # => ['.cgi', '.fcgi', '.gyp', ...]
3333
```
3434

3535
_Note: Most type checkers will falsely warn_ `programming_languages` _is not subscriptable because they are incapable of analyzing runtime behavior (where the module is replaced w/ a dictionary for cleaner, direct access). You can safely suppress such warnings using_ `# type: ignore`.
@@ -41,7 +41,7 @@ List all extensions for a language:
4141
```py
4242
js_exts = programming_languages['JavaScript']['extensions']
4343

44-
print(js_exts) # => ['.js', '._js', '.bones', '.cjs', ...]
44+
print(js_exts) # => ['._js', '.bones', '.cjs', '.es', ...]
4545
```
4646

4747
Get language from an extension:
@@ -58,12 +58,12 @@ print(get_lang('.rs')) # => 'Rust'
5858
Filter by language type:
5959

6060
```py
61-
markup_langs = {
61+
markup_langs = [
6262
lang for lang, data in programming_languages.items()
6363
if data['type'] == 'markup'
64-
}
64+
]
6565

66-
print(markup_langs) # => ['HTML+ECR', 'PostCSS', 'Go Template', 'SCSS', ...]
66+
print(markup_langs) # => ['Antlers', 'API Blueprint', 'Astro', 'BibTeX', ...]
6767
print(f'{len(markup_langs)} markup languages') # -> '69 markup languages'
6868
```
6969

0 commit comments

Comments
 (0)