INNER CODE UNIT · Python

validate_default

racenis/tram-sdk · devtools/codegen.py:265

def validate_default(value, type):
	if not value:
		value = ""

	v = value.strip()

	if type == "string":
		if len(v) >= 2 and v.startswith('"') and v.endswith('"'):
			return v
		return '"none"'
	if type == "bool":
		if v == "true":
			return "1"
		if v == "false":
			return "0"
		return "0"
	if type == "float":
		if FLOAT_RE.match(v):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…