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
{{ message }}
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.
Hi,
my changes to resolve the multiple names issue has essentially made dunder-getitem() and get_list() the same, except that dunder-getitem() returns either a list or a single object depending on the number of child elements. This made the client code in name() more complex as I had to check if a list or Element was returned.
The name() method could use get_list() instead and if we were to add, say, a spouses() property, this would use the same mechanism. Or we could remove the get_list() method and always return a list from the dunder-getitem() method.
This issue is mainly at the discussion stage - what do you see as the way forward?
Cheers,
Chris.
The text was updated successfully, but these errors were encountered:
Perhaps you're right. Maybe x['FOO'] should always return a list. For things which there should only be one result (e.g. SEX), you can write a custom property (like has been done). Then dunder-getitem would be a low-level data access approach for people familiar with GEDCOM, and we can add pythonic functions/properties for things of which make sense (i.e. hiding the how it is implemented in GEDCOM).
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
my changes to resolve the multiple names issue has essentially made dunder-getitem() and get_list() the same, except that dunder-getitem() returns either a list or a single object depending on the number of child elements. This made the client code in name() more complex as I had to check if a list or Element was returned.
The name() method could use get_list() instead and if we were to add, say, a spouses() property, this would use the same mechanism. Or we could remove the get_list() method and always return a list from the dunder-getitem() method.
This issue is mainly at the discussion stage - what do you see as the way forward?
Cheers,
Chris.
The text was updated successfully, but these errors were encountered: