def _create_all_new_chains(self, converter) -> Tuple[List[Converter], List[Converter],<EOL>List[Converter], List[Converter]]:
specific_chains, specific_nonstrict_chains, generic_chains, generic_nonstrict_chains = [], [], [], []<EOL>if converter.is_generic():<EOL><INDENT>generic_chains.append(ConversionChain(initial_converters=[converter], strict_chaining=True))<EOL><DEDENT>else:<EOL><INDENT>specific_chains.append(ConversionChain(initial_converters=[converter], strict_chaining=True))<EOL><DEDENT>new_c_at_end_ns = []<EOL>new_c_at_beginning_ns = []<EOL>if not self.strict:<EOL><INDENT>for existing_specific_nonstrict in self._specific_non_strict_conversion_chains:<EOL><INDENT>if converter.can_be_appended_to(existing_specific_nonstrict, strict=False):<EOL><INDENT>if ConversionChain.are_worth_chaining(existing_specific_nonstrict, converter):<EOL><INDENT>new_c_at_end_ns.append(ConversionChain.chain(existing_specific_nonstrict, converter,<EOL>strict=False))<EOL><DEDENT><DEDENT>if existing_specific_nonstrict.can_be_appended_to(converter, strict=False):<EOL><INDENT>if ConversionChain.are_worth_chaining(converter, existing_specific_nonstrict):<EOL><INDENT>new_c_at_beginning_ns.append(ConversionChain.chain(converter, existing_specific_nonstrict,<EOL>strict=False))<EOL><DEDENT><DEDENT><DEDENT><DEDENT>new_c_at_end = []<EOL>new_c_at_beginning = []<EOL>for existing_specific in self._specific_conversion_chains:<EOL><INDENT>if converter.can_be_appended_to(existing_specific, strict=True):<EOL><INDENT>if ConversionChain.are_worth_chaining(existing_specific, converter):<EOL><INDENT>new_c_at_end.append(ConversionChain.chain(existing_specific, converter, strict=True))<EOL><DEDENT><DEDENT>elif (not self.strict) and converter.can_be_appended_to(existing_specific, strict=False):<EOL><INDENT>if ConversionChain.are_worth_chaining(existing_specific, converter):<EOL><INDENT>new_c_at_end_ns.append(ConversionChain.chain(existing_specific, converter, strict=False))<EOL><DEDENT><DEDENT>if existing_specific.can_be_appended_to(converter, strict=True):<EOL><INDENT>if ConversionChain.are_worth_chaining(converter, existing_specific):<EOL><INDENT>new_c_at_beginning.append(ConversionChain.chain(converter, existing_specific, strict=True))<EOL><DEDENT><DEDENT>elif (not self.strict) and existing_specific.can_be_appended_to(converter, strict=False):<EOL><INDENT>if ConversionChain.are_worth_chaining(converter, existing_specific):<EOL><INDENT>new_c_at_beginning_ns.append(ConversionChain.chain(converter, existing_specific, strict=False))<EOL><DEDENT><DEDENT><DEDENT>if converter.is_generic():<EOL><INDENT>generic_chains += new_c_at_end<EOL>generic_nonstrict_chains += new_c_at_end_ns<EOL><DEDENT>else:<EOL><INDENT>specific_chains += new_c_at_end<EOL>specific_nonstrict_chains += new_c_at_end_ns<EOL><DEDENT>specific_chains += new_c_at_beginning<EOL>specific_nonstrict_chains += new_c_at_beginning_ns<EOL>for a in new_c_at_end:<EOL><INDENT>for b in new_c_at_beginning:<EOL><INDENT>b_ = b.remove_first()<EOL>if b_.can_be_appended_to(a, strict=True):<EOL><INDENT>if ConversionChain.are_worth_chaining(a, b_):<EOL><INDENT>specific_chains.append(ConversionChain.chain(a, b_, strict=True))<EOL><DEDENT><DEDENT><DEDENT>for b in new_c_at_beginning_ns:<EOL><INDENT>b_ = b.remove_first()<EOL>if b_.can_be_appended_to(a, strict=False):<EOL><INDENT>if ConversionChain.are_worth_chaining(a, b_):<EOL><INDENT>specific_nonstrict_chains.append(ConversionChain.chain(a, b_, strict=False))<EOL><DEDENT><DEDENT><DEDENT><DEDENT>for a in new_c_at_end_ns:<EOL><INDENT>for b in (new_c_at_beginning_ns + new_c_at_beginning):<EOL><INDENT>b_ = b.remove_first()<EOL>if b_.can_be_appended_to(a, strict=False):<EOL><INDENT>if ConversionChain.are_worth_chaining(a, b_):<EOL><INDENT>specific_nonstrict_chains.append(ConversionChain.chain(a, b_, strict=False))<EOL><DEDENT><DEDENT><DEDENT><DEDENT>if converter.is_generic():<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>new_c_at_beginning_generic = []<EOL>new_c_at_beginning_generic_ns = []<EOL>for existing_specific in self._generic_conversion_chains:<EOL><INDENT>if existing_specific.can_be_appended_to(converter, strict=True):<EOL><INDENT>if ConversionChain.are_worth_chaining(converter, existing_specific):<EOL><INDENT>new_c_at_beginning_generic.append(ConversionChain.chain(converter, existing_specific,<EOL>strict=True))<EOL><DEDENT><DEDENT>elif (not self.strict) and existing_specific.can_be_appended_to(converter, strict=False):<EOL><INDENT>if ConversionChain.are_worth_chaining(converter, existing_specific):<EOL><INDENT>new_c_at_beginning_generic_ns.append(ConversionChain.chain(converter, existing_specific,<EOL>strict=False))<EOL><DEDENT><DEDENT><DEDENT>for existing_specific_ns in self._generic_nonstrict_conversion_chains:<EOL><INDENT>if existing_specific_ns.can_be_appended_to(converter, strict=False):<EOL><INDENT>if ConversionChain.are_worth_chaining(converter, existing_specific_ns):<EOL><INDENT>new_c_at_beginning_generic_ns.append(ConversionChain.chain(converter, existing_specific_ns,<EOL>strict=False))<EOL><DEDENT><DEDENT><DEDENT>generic_chains += new_c_at_beginning_generic<EOL>generic_nonstrict_chains += new_c_at_beginning_generic_ns<EOL>for a in new_c_at_end:<EOL><INDENT>for b in new_c_at_beginning_generic:<EOL><INDENT>b_ = b.remove_first()<EOL>if b_.can_be_appended_to(a, strict=True):<EOL><INDENT>if ConversionChain.are_worth_chaining(a, b_):<EOL><INDENT>generic_chains.append(ConversionChain.chain(a, b_, strict=True))<EOL><DEDENT><DEDENT><DEDENT>for b in new_c_at_beginning_generic_ns:<EOL><INDENT>b_ = b.remove_first()<EOL>if b_.can_be_appended_to(a, strict=False):<EOL><INDENT>if ConversionChain.are_worth_chaining(a, b_):<EOL><INDENT>generic_nonstrict_chains.append(ConversionChain.chain(a, b_, strict=False))<EOL><DEDENT><DEDENT><DEDENT><DEDENT>for a in new_c_at_end_ns:<EOL><INDENT>for b in (new_c_at_beginning_generic_ns + new_c_at_beginning_generic):<EOL><INDENT>b_ = b.remove_first()<EOL>if b_.can_be_appended_to(a, strict=False):<EOL><INDENT>if ConversionChain.are_worth_chaining(a, b_):<EOL><INDENT>generic_nonstrict_chains.append(ConversionChain.chain(a, b_, strict=False))<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>return generic_chains, generic_nonstrict_chains, specific_chains, specific_nonstrict_chains<EOL>
Creates all specific and generic chains that may be built by adding this converter to the existing chains.

:param converter:
:return: generic_chains, generic_nonstrict_chains, specific_chains, specific_nonstrict_chains