Created
April 30, 2022 19:01
-
-
Save vinitkumar/8688ca7afb0765bd3d4d601370c3e1ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def convert_none( | |
key: str, val: None, attr_type: bool, attr: Dict[str, Any] = {}, cdata: bool = False | |
) -> str: | |
"""Converts a null value into an XML element""" | |
LOG.info(f'Inside convert_none(): key="{str(key)}" val={type(val)}') | |
key, attr = make_valid_xml_name(key, attr) | |
if attr_type: | |
attr["type"] = get_xml_type(val) | |
attrstring = make_attrstring(attr) | |
return f"<{key}{attrstring}></{key}>" | |
################################# | |
mypyc temp.pyl.py | |
json2xml/temp.py: error: Local variable "val" has inferred type None; add an annotation | |
################################## | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment