Closed dlecocq closed 8 years ago
LGTM, but I wonder if the trade off of recomputing toString()
is a great one. The downside to keeping the fully formed URL is twice the space for the object.
I'm not sure what you mean -- are you suggesting we memoize the string representation?
Yeah, that's what I was considering whether it was beneficial to store the full URL potentially in the constructor. Then the question is whether you eagerly store it or only on demand.
It's going to change when people start doing normalizations, so I figure it's best to do so lazily. Another use-case is to extract the PLD / TLD / FQDN, in which case str()
would never even be invoked.
@b4hand @tanglyh @tammybailey @martin-seomoz