Simplify with built-in functions where possible. e.g.
change [x for x in y if x] to filter(None, y) change [f(x) for x in y] to map(f, x) change [x for x in y] to list(y) These changes reduce source code size and complexity and produce some minor performance gains svn: r14104
This commit is contained in:
src
Filters
Rules
Place
GrampsLogger
ScratchPad.pySimple
UndoHistory.pyUtils.pydocgen
gen
db
lib
addressbase.pyattrbase.pyfamily.pyldsordbase.pymediabase.pynotebase.pyperson.pysrc.pysrcbase.pyurlbase.py
proxy
gui
plugins
export
gramplet
import
lib
tool
view
web
test/GrampsDb
@ -873,7 +873,7 @@ class GedcomWriter(UpdateCallback):
|
||||
event to discover the event type.
|
||||
|
||||
"""
|
||||
for event_ref in [ ref for ref in family.get_event_ref_list()]:
|
||||
for event_ref in family.get_event_ref_list():
|
||||
event = self.dbase.get_event_from_handle(event_ref.ref)
|
||||
etype = int(event.get_type())
|
||||
val = libgedcom.familyConstantEvents.get(etype)
|
||||
|
Reference in New Issue
Block a user