aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexilla/test/examples/python/x.py
blob: 57833c05948c68278bfa36e35cb4c00767e1e729 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Convert all punctuation characters except '_', '*', and '.' into spaces.
def depunctuate(s):
	'''A docstring'''
	"""Docstring 2"""
	d = ""
	for ch in s:
		if ch in 'abcde':
			d = d + ch
		else:
			d = d + " "
	return d

import contextlib

@contextlib.contextmanager
def singleuse():
	print("Before")
	yield
with singleuse(): pass