Commit Graph

5 Commits

Author SHA1 Message Date
Eklavya Sharma c59740385d zerver/lib/str_utils.py: Replace ValueError by TypeError.
When a parameter of a wrong type is passed to a `force_*` method
in str_utils.py, raise a TypeError.
2016-07-21 23:14:00 +05:30
Eklavya Sharma 7956fcbf0d zerver/lib/str_utils.py: Allow specifying encoding. 2016-07-07 10:06:22 -07:00
Eklavya Sharma ed61c4c581 Improve model string representation.
Define __str__, __repr__ and __unicode__ correctly on models.
This will help in python 3 compatibility.
2016-06-12 09:55:12 -07:00
Eklavya Sharma f18493f922 Add documentation about zerver/lib/str_utils.py. 2016-06-11 17:31:56 +05:30
Eklavya Sharma 6d29da8cee Add zerver/lib/str_utils.py.
str_utils.py has functions for converting strings from one type to
another.  It also has a TypeVar called NonBinaryStr, which is like AnyStr
except that it doesn't allow bytes.
2016-06-11 16:17:47 +05:30