bicycle repair man help

Rob Weir rweir at ertius.org
Wed Jun 27 03:05:52 EDT 2007


On 6/24/07, Rustom Mody <rustompmody at gmail.com> wrote:
> Does someone know that when using bicycle repair man to refactor python code
> what exactly extract local variable means?

It means extracting a part (or all of) an expression and replacing it
with a sensibly-named local variable.

Shamelessly copied from c2:

> For example:
>
>  if ( (x==0) || ((y<17) && name == null) ) {
>    ..
>  }
>
> becomes:
>
>  final boolean outOfActiveAreal = (x==0) || ((y<17) && name == null) ;
>  if (outOfActiveAreal ) {
>    ..
>  }

Some more articles:

http://refactoring.com/catalog/introduceExplainingVariable.html and
http://c2.com/cgi-bin/wiki?IntroduceExplainingVariable have
discussions of them.

-rob



More information about the Python-list mailing list