You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
passing dicts is good enough for the machine learning in python community, so it's good enough for us.
However, since we don't need quite the flexibility in configs the machine learning community needs, it looks like we can hardcode field names of config objects.
Passing around dictionaries will be annoying for the user in our case because what if a field is incorrect or missing?
# Python code to demonstrate namedtuple()fromcollectionsimportnamedtuple# Declaring namedtuple()Student=namedtuple('Student', ['name', 'age', 'DOB'])
# Adding valuesS=Student('Nandini', '19', '2541997')
# Access using indexprint("The Student age using index is : ", end="")
print(S[1])
# Access using nameprint("The Student name using keyname is : ", end="")
print(S.name)
The text was updated successfully, but these errors were encountered:
Indeed, this how ppx_python works for now, see plans on #4 , cc @thierry-martinez ; also, all the objects we generate are coming from well-typed OCaml definitions so definitively we should generate Python types too.
passing
dict
s is good enough for the machine learning in python community, so it's good enough for us.However, since we don't need quite the flexibility in configs the machine learning community needs, it looks like we can hardcode field names of config objects.
Passing around dictionaries will be annoying for the user in our case because what if a field is incorrect or missing?
From
GeeksForGeeks
The text was updated successfully, but these errors were encountered: