-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python27 support #36
Python27 support #36
Conversation
이 정도면 그냥 |
@dahlia 아예 http://pythonhosted.org/six/#module-six.moves 이런게있더군요.. 이걸로 해두겠습니다. |
f5c5294
to
a0c0ddc
Compare
a0c0ddc
to
54e4e47
Compare
54e4e47
to
0bd10ae
Compare
if PY3: | ||
return cls_.__qualname__ | ||
else: | ||
return cls_.__name__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 그냥 return getattr(cls, '__qualname__', cls.__name__)
으로 하는 게 낫겠네요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그런데 오류 메세지 등에서 쓰려는 거면 typing._type_repr()
함수 그대로 가져다 쓰면 될 것 같습니다.
>>> typing._type_repr(int)
'int'
>>> typing._type_repr(typing.Mapping[str, int])
'typing.Mapping[str, int]'
try: | ||
full_url = req.full_url | ||
except AttributeError: | ||
full_url = req.get_full_url() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.full_url
은 Python 3에서 생겼지만 .get_full_url()
메서드는 예나 지금이나 있으니까 그냥 후자로만 쓰면 될 것 같습니다.
[testenv] | ||
deps = -e.[tests] | ||
commands= | ||
py.test -v tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.travis.yml에도 해당 변경 반영해야 할 것 같습니다.
@@ -0,0 +1,7 @@ | |||
[tox] | |||
envlist = py27,py35 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.travis.yml에서는 3.4도 테스트하게 돼있는데 여기는 py34가 없네요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네 그리고 방금 CI에서 터지는걸발견했는데 typing <3.5.2
에서
class A:
pass
typing.Optional[A]
가 터지는걸 체크해서 고쳤습니다
#22