Skip to content

Added names function which returns attr names for an attrs class. #66

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

Closed
wants to merge 1 commit into from
Closed

Conversation

kissgyorgy
Copy link

No description provided.

@codecov-io
Copy link

codecov-io commented Aug 19, 2016

Current coverage is 100% (diff: 100%)

Merging #66 into master will not change coverage

@@           master   #66   diff @@
===================================
  Files           7     7          
  Lines         362   364     +2   
  Methods         0     0          
  Messages        0     0          
  Branches       86    87     +1   
===================================
+ Hits          362   364     +2   
  Misses          0     0          
  Partials        0     0          

Powered by Codecov. Last update 5a1814f...34d7744

@hynek
Copy link
Member

hynek commented Aug 20, 2016

What would be the concrete use case of this function?

@Tinche
Copy link
Member

Tinche commented Aug 20, 2016

Appreciate the thought and effort, but it's kind of a one-liner.

@hynek
Copy link
Member

hynek commented Aug 22, 2016

I have to agree with Tinche; thank you but sorry I’m trying to keep the API as lean as humanly possible.

@hynek hynek closed this Aug 22, 2016
@kissgyorgy
Copy link
Author

What would be the concrete use case of this function?

I needed the attribute names of the class. I had two choices:

  • use C.__attrs_attrs__ which is ugly and private
  • use [a.name for a in attr.fields(C)] which is too verbose IMO, and I need to know about Attribute objects and what attributes they have

@hynek
Copy link
Member

hynek commented Aug 23, 2016

I’d still like to know for what that’s useful? I’m asking because if it’s something super common, I could live with it. If it’s rather obscure, you’ll have to live an own function. :)

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.

4 participants