<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def conversion(self, idx):
 """ Switches into the 'conversion' state, used to parse a % conversion. :param idx: The format string index at which the conversion begins. """


        self.state.append('conversion')
        self.str_begin = idx
        self.param_begin = None
        self.conv_begin = None
        self.modifier = conversions.Modifier()
        self.codes = []
        self.reject = False
        self.code_last = False