def lastpart(x):
	"""
	Get the last identifier in a dotted expression
	"foo.bar.baz" -> "baz"
	"foo.bar" -> "bar"
	"foo" -> "foo"
	"""
	pos = x.rfind(".")
	if pos == -1:
		return x
	else:
		return x[pos+1:]