  Using three-dimensional convection simulations it is shown that a sinusoidal
variation of horizontal shear leads to a kinematic \alpha effect with a similar
sinusoidal variation. The effect exists even for weak stratification and arises
owing to the inhomogeneity of turbulence and the presence of impenetrable
vertical boundaries. This system produces large-scale magnetic fields that also
show a sinusoidal variation in the streamwise direction. It is argued that
earlier investigations overlooked these phenomena partly because of the use of
horizontal averaging and also because measurements of \alpha using an imposed
field combined with long time averages give erroneous results. It is
demonstrated that in such cases the actual horizontally averaged mean field
becomes non-uniform. The turbulent magnetic diffusion term resulting from such
non-uniform fields can then no longer be neglected and begins to balance the
\alpha effect.
