Taught to the monks assembled at Jetavana. There are four ways of professing a doctrine — one temporarily pleasant but ripening to pain thereafter; another temporarily unpleasant but ripening to pleasure, etc.
The sutta also describes the monks and recluses who follow these different ways. M.i.305 ff