Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __add_user_def(self, name):
if name not in self.__user_defs:
self.__user_defs.append(name)
# Remove any modules and members that were added before any known user-definitions. Do it in
# reverse so the indices are kept while traversing!
for ud in self.__user_defs:
for i in reverse_range(self.__modules):
if self.__modules[i] == ud:
self.__vvvvprint("Ignoring module '{}' because it's user-defined!".format(ud))
del(self.__modules[i])
for i in reverse_range(self.__members):
if self.__members[i] == ud:
self.__vvvvprint("Ignoring member '{}' because it's user-defined!".format(ud))
del(self.__members[i])
def __add_user_def(self, name):
if name not in self.__user_defs:
self.__user_defs.append(name)
# Remove any modules and members that were added before any known user-definitions. Do it in
# reverse so the indices are kept while traversing!
for ud in self.__user_defs:
for i in reverse_range(self.__modules):
if self.__modules[i] == ud:
self.__vvvvprint("Ignoring module '{}' because it's user-defined!".format(ud))
del(self.__modules[i])
for i in reverse_range(self.__members):
if self.__members[i] == ud:
self.__vvvvprint("Ignoring member '{}' because it's user-defined!".format(ud))
del(self.__members[i])