It's an only slightly perjorative term for a clever person. It's usually used in the context of affectionate teasing, as in your example. Including the "Mr." is optional. :)
[not a teacher]
Student or Learner
(They are sculpting clay)
It's a reindeer! Don't you see its little antlers and ... OK, Mr. Smarty Pants, what's yours supposed to be?
Who is Mr. Smarty Pants? And what connotations does it have to you? Thanks.
I mean, the way you tease someone you feel affection towards. In other words, they know you're only teasing and take it in the right spirit.
Mother to child: "You big silly! If you wear your sunglasses in the house, you won't be able to see."
Wife to husband: "Okay, Superman, if you don't want the ladder in the house, how do you suggest we get the angel on top of the Christmas tree?"
Employee to boss: "You goofball, I can't believe you forgot to bring the contract." NOPE! This would not be an occasion for affectionate teasing! :)
Thanks, Melmobile, for the wonderful explanations and samples.
I wonder if I could use friendly teasing to my close friends. I mean, does "friendly teasing" sounds right, too?