title: Flask redirect url_for changing type of parameter
body: <p>I have the following code in Flask/python that involves a variable years that is a list of ints. However, when I use <code>return redirect(url_for(...</code>, years becomes unicode and if it had been [2015, 2014], it becomes '[','2','0','1','5',' ', etc...</p>
  
  <pre><code>@main.route('/search', methods=('GET','POST'))
  def fysearch():
      form = SelectYear()
      if form.validate_on_submit():
          years = form.years.data
          return redirect(url_for('.yearresults', years=years))
      return render_template('select_year.html', form=form)
  </code></pre>
  
  <p>When I print the type of each element in years above, it is a normal int as I want it to be. Once it is passed into the redirect url_for, that is when years turns into unicode. </p>
  
  <pre><code>@main.route('/searchresults/&lt;years&gt;')
  def yearresults(years):
      page = request.args.get('page', 1, type=int)
      print type(years)
      pagination = Grant.query.filter(Grant.fy.in_(years)).\
              paginate(page, per_page=current_app.config['POSTS_PER_PAGE'],
          error_out=False)
      return render_template('yearresults.html', years=years, entries=pagination.items, pagination=pagination
  </code></pre>
  
  <p>I know there are ways to revert years back to a list of ints after it has been passed to <code>yearresults(years)</code> like years=json.loads(years) or replacing the [ and ] and splitting, but I was wondering if there is a different way to fix this issue. I have thought about a converter in the url routing, but I am not sure how that works since I am using flask blueprints. 
  Thanks in advance! </p>