catppuccin/samples/python.py
Hamothy b9bbd77c7f
docs: restructure & improve contrib docs (#1876)
* docs: restructure & improve contrib docs

* chore: rework samples code

* docs: fix capitalization & brand names

* docs: PR comments & try to standardise palette vs flavor

* docs: add sample-programs

* docs: update submission guidelines (refs: #1821)

* refactor: tidy up docs

Co-authored-by: winston <hey@winston.sh>
2023-01-26 19:53:05 +01:00

32 lines
825 B
Python

@decorator(param=1)
def f(x):
"""
Syntax Highlighting Demo
@param x Parameter
Semantic highlighting:
Generated spectrum to pick colors for local variables and parameters:
Color#1 SC1.1 SC1.2 SC1.3 SC1.4 Color#2 SC2.1 SC2.2 SC2.3 SC2.4 Color#3
Color#3 SC3.1 SC3.2 SC3.3 SC3.4 Color#4 SC4.1 SC4.2 SC4.3 SC4.4 Color#5
"""
def nested_func(y):
print(y + 1)
s = ("Test", 2+3, {'a': 'b'}, f'{x!s:{"^10"}}') # Comment
f(s[0].lower())
nested_func(42)
class Foo:
tags: List[str]
def __init__(self: Foo):
byte_string: bytes = b'newline:\n also newline:\x0a'
text_string = u"Cyrillic Я is \u042f. Oops: \u042g"
self.make_sense(whatever=1)
def make_sense(self, whatever):
self.sense = whatever
x = len('abc')
print(f.__doc__)