--
> My recommendation is to use doctest to test the code samples that
> naturally occur in your docstrings, but not to use it as a
> general-purpose testing tool. It has too many limitations and quirks,
> and if you're going to write sepa
gordian...@gmail.com於 2015年1月12日星期一 UTC+8下午12時20分46秒寫道:
> #!/usr/bin/python
> # -*- coding: utf-8 -*-
>
> import re
> kivy_class_ptn = re.compile(r"<\b[\w_.\@\+]+>:?")
>
>
> def test_kivy_class(s):
> """
> >>> s = ":"
> >>> test_kivy_class(s)
> ":"
> >>> s = ""
> >>>
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re
kivy_class_ptn = re.compile(r"<\b[\w_.\@\+]+>:?")
def test_kivy_class(s):
"""
>>> s = ":"
>>> test_kivy_class(s)
":"
>>> s = ""
>>> test_kivy_class(s)
""
"""
ret = re.search(kivy_class_ptn, s)
if re