Not quite....that's just what cops write on the ticket "failure to drive in a marked lane", but that's a bad paraphrasing of 154 which actually doesn't imply quite the same meaning. It doesn't mention passing as the reason to leave the lane, nor does it exclude the ability to do so. It speaks of "practicable" (vague), and "safe" (judgment call).
If I feel the only way I can pass 100 cars at a light is to leave my lane, and I determine it is safe then technically I am within the law. i.e. it is not praticable to stay in my lane and still pass all these cars. Do I have the right to pass? Surely, who says I don't (if it is safe)?!?!
To argue it was not practicable is baseless as then any cop can argue you had no need to pass, therefore leave one's lane, even before assessing safety.
First and foremost you assess a practical (subjective) reason to leave your lane, then judge it's safety (subjective), then it's legal.
When cops write "failure to drive in a marked lane" this is just plain inaccurate short hand and they often fail to understand the law.
Where highway divided into lanes
154. (1) Where a highway has been divided into clearly marked lanes for traffic,
(a) a vehicle shall be driven as nearly as may be practicable entirely within a single lane and shall not be moved from the lane until the driver has first ascertained that the movement can be made with safety;
(b) in the case of a highway that is divided into three lanes, a vehicle shall not be driven in the centre lane except when overtaking and passing another vehicle where the roadway is clearly visible and the centre lane is clear of traffic within a reasonable safe distance, or in preparation for a left turn, or where the centre lane is at the time designated for the use of traffic moving in the direction in which the vehicle is proceeding and official signs are erected to indicate the designation;
(c) any lane may be designated for slowly moving traffic, traffic moving in a particular direction or classes or types of vehicles and, despite section 141, where a lane is so designated and official signs indicating the designation are erected, every driver shall obey the instructions on the official signs. R.S.O. 1990, c. H.8, s. 154 (1).
Exception
(2) Where safety is not jeopardized, clauses (1) (b) and (c) do not apply to road service vehicles and clause (1) (c) does not apply to road-building machines or apparatus while engaged in the construction of a highway. R.S.O. 1990, c. H.8, s. 154 (2).