Skip to content

Conversation

@ambv
Copy link
Contributor

@ambv ambv commented Apr 11, 2018

Also updated the docstring to reflect why exactly we're doing what we're doing.
The previous comment was incorrect (typing is already imported in
applications using annotations).

I added t.ClassVar as well which is the only third alternative import I found
in use for typing-related classes.

Fixes #361

Also updated the docstring to reflect why exactly we're doing what we're doing.
The previous comment was incorrect (`typing` is already imported in
applications using annotations).

I added `t.ClassVar` as well which is the only third alternative import I found
in use for typing-related classes.

Fixes python-attrs#361
@codecov
Copy link

codecov bot commented Apr 11, 2018

Codecov Report

Merging #367 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #367   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           9      9           
  Lines         830    831    +1     
  Branches      174    174           
=====================================
+ Hits          830    831    +1
Impacted Files Coverage Δ
src/attr/_make.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 57817b2...4f105c6. Read the comment docs.

def _is_class_var(annot):
"""
Check whether *annot* is a typing.ClassVar.
"""Check whether *annot* is a typing.ClassVar.

This comment was marked as spam.

This comment was marked as spam.

disadvantage compared to plain old classes.
"""
return str(annot).startswith("typing.ClassVar")
return str(annot).startswith(("typing.ClassVar", "t.ClassVar", "ClassVar"))

This comment was marked as spam.

This comment was marked as spam.

@hynek
Copy link
Member

hynek commented Apr 14, 2018

🏓

@hynek hynek added this to the 18.1 milestone Apr 21, 2018
@ambv
Copy link
Contributor Author

ambv commented Apr 22, 2018

(updated)

@hynek hynek requested a review from euresti April 23, 2018 05:59
Copy link
Contributor

@euresti euresti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Thanks!

@hynek hynek merged commit 7cb8c82 into python-attrs:master Apr 23, 2018
@hynek
Copy link
Member

hynek commented Apr 23, 2018

Thanks everyone! At least we can feel bad about that hack together. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants