A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2017-November/150977.html below:

[Python-Dev] Third and hopefully final post: PEP 557, Data Classes

[Python-Dev] Third and hopefully final post: PEP 557, Data ClassesSerhiy Storchaka storchaka at gmail.com
Thu Nov 30 06:56:52 EST 2017
30.11.17 03:02, Guido van Rossum пише:
> I tried to look up the discussion but didn't find much except that you 
> flagged this as an issue. To repeat, your concern is that isdataclass() 
> applies to *instances*, not classes, which is how Eric has designed it, 
> but you worry that either through the name or just because people don't 
> read the docs it will be confusing. What do you suppose we do? I think 
> making it work for classes as well as for instances would cause another 
> category of bugs (confusion between cases where a class is needed vs. an 
> instance abound in other situations -- we don't want to add to that). 
> Maybe it should raise TypeError when passed a class (unless its 
> metaclass is a dataclass)? Maybe it should be renamed to 
> isdataclassinstance()? That's a mouthful, but I don't know how common 
> the need to call this is, and people who call it a lot can define their 
> own shorter alias.

There is isdatadescriptor() which is not too shorter.

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4