I look at it like would I trade Nylander at $7m X 4 years, then he's UFA, for Pietrangelo at $9m X 7 years (when he'd be 37 at contract maturity)?
Given where the Leafs' defense vs. offense is at, I say yes. Pietrangelo doesn't seem to have any big injury issues, plays 25 minutes per game, scores very well, is RHD, and is a team captain.
So if you ask me if I'd sign Pietrangelo to that contract, and get the proceeds of trading Nylander (futures, maybe a goalie prospect, maybe another great d-man prospect)? I'm all in.
There's always going to be inherent risks, but Pietrangelo is a pretty solid bet.