class_docstr: Nested annotation structure.
  
  >>> bar = hl.Struct(**{'foo': 5, '1kg': 10})
  
  Struct elements are treated as both 'items' and 'attributes', which
  allows either syntax for accessing the element "foo" of struct "bar":
  
  >>> bar.foo
  >>> bar['foo']
  
  Field names that are not valid Python identifiers, such as fields that
  start with numbers or contain spaces, must be accessed with the latter
  syntax:
  
  >>> bar['1kg']
  
  The ``pprint`` module can be used to print nested Structs in a more
  human-readable fashion:
  
  >>> from pprint import pprint
  >>> pprint(bar)
  
  Parameters
  ----------
  attributes
      Field names and values.
  
  Note
  ----
  This object refers to the Python value returned by taking or collecting
  Hail expressions, e.g. ``mt.info.take(5)``. This is rare; it is much
  more common to manipulate the :class:`.StructExpression` object, which is
  constructed using the :func:`.struct` function.
class_docstr_tok: ["Nested","annotation","structure",".",">",">",">","bar","=","hl.Struct","(","*","*","{","'foo","'",":","5",",","'1kg","'",":","10","}",")","Struct","elements","are","treated","as","both","'items","'","and","'attributes","'",",","which","allows","either","syntax","for","accessing","the","element","``","foo","''","of","struct","``","bar","''",":",">",">",">","bar.foo",">",">",">","bar","[","'foo","'","]","Field","names","that","are","not","valid","Python","identifiers",",","such","as","fields","that","start","with","numbers","or","contain","spaces",",","must","be","accessed","with","the","latter","syntax",":",">",">",">","bar","[","'1kg","'","]","The","``","pprint","``","module","can","be","used","to","print","nested","Structs","in","a","more","human-readable","fashion",":",">",">",">","from","pprint","import","pprint",">",">",">","pprint","(","bar",")","Parameters","--","--","--","--","--","attributes","Field","names","and","values",".","Note","--","--","This","object","refers","to","the","Python","value","returned","by","taking","or","collecting","Hail","expressions",",","e.g",".","``","mt.info.take","(","5",")","``",".","This","is","rare",";","it","is","much","more","common","to","manipulate","the",":","class",":","`",".StructExpression","`","object",",","which","is","constructed","using","the",":","func",":","`",".struct","`","function","."]
code: def __init__(self, **kwargs):
      # Set this way to avoid an infinite recursion in `__getattr__`.
      self.__dict__["_fields"] = kwargs
  
imports: from typing import Dict, Any
  from collections import OrderedDict
  from collections.abc import Mapping
  import pprint
  from hail.utils.misc import get_nice_attr_error, get_nice_field_error
  from hail.typecheck import typecheck, typecheck_method, anytype
label_desc: Use image node_id 1 to create a new Struct object from inherited base classes: Mapping with example: obj = Struct()