
GITHUB . COM {
}
Detected CMS Systems:
- Wordpress (2 occurrences)
Title:
GenericModel does not support generic subclasses Β· Issue #947 Β· pydantic/pydantic
Description:
Bug It seems the implementation of pydantic.generics.GenericModel does not support generic subclasses. Example: import pydantic.generics import typing T = typing.TypeVar("T") class ResponseModel(pydantic.generics.GenericModel, typing.Gen...
Website Age:
17 years and 8 months (reg. 2007-10-09).
Matching Content Categories {π}
- DIY & Home Improvement
- Family & Parenting
- Education
Content Management System {π}
What CMS is github.com built with?
Github.com is powered by WORDPRESS.
Traffic Estimate {π}
What is the average monthly size of github.com audience?
ππ Tremendous Traffic: 10M - 20M visitors per month
Based on our best estimate, this website will receive around 10,000,019 visitors per month in the current month.
However, some sources were not loaded, we suggest to reload the page to get complete results.
check SE Ranking
check Ahrefs
check Similarweb
check Ubersuggest
check Semrush
How Does Github.com Make Money? {πΈ}
Subscription Packages {π³}
We've located a dedicated page on github.com that might include details about subscription plans or recurring payments. We identified it based on the word pricing in one of its internal links. Below, you'll find additional estimates for its monthly recurring revenues.How Much Does Github.com Make? {π°}
Subscription Packages {π³}
Prices on github.com are in US Dollars ($).
They range from $4.00/month to $21.00/month.
We estimate that the site has approximately 4,989,889 paying customers.
The estimated monthly recurring revenue (MRR) is $20,957,532.
The estimated annual recurring revenues (ARR) are $251,490,385.
Wordpress Themes and Plugins {π¨}
What WordPress theme does this site use?
It is strange but we were not able to detect any theme on the page.
What WordPress plugins does this website use?
It is strange but we were not able to detect any plugins on the page.
Keywords {π}
pydantic, fix, verified, type, generic, bug, issue, concrete, vars, present, parent, sign, support, subclasses, import, parameters, added, daviskirk, gener, navigation, pull, requests, actions, security, genericmodel, drpyser, class, model, types, check, typinggeneric, version, related, dmontagu, commits, reference, github, projects, milestone, footer, skip, content, menu, product, solutions, resources, open, source, enterprise, pricing,
Topics {βοΈ}
support generic subclasses personal information genericmodel comment metadata assignees concrete generic models fully concrete type pydantic v1 generics import typing import pydantic concrete type parameters generic types generic usages bug concrete model parent gener⦠concrete instantiation concrete types type variables type vars type projects erroneously considered feature request projects milestone milestone relationships class responsemodel github genericmodel generic[ generic pydantic sys version concrete type generics responsemodel[ parameters = typing typing skip jump sign implementation typevar data list[ total_count parameterize class_getitem check __class_getitem__
Payment Methods {π}
- Braintree
Questions {β}
- Already have an account?
Schema {πΊοΈ}
DiscussionForumPosting:
context:https://schema.org
headline:GenericModel does not support generic subclasses
articleBody:# Bug
It seems the implementation of pydantic.generics.GenericModel does not support generic subclasses. Example:
```
import pydantic.generics
import typing
T = typing.TypeVar("T")
class ResponseModel(pydantic.generics.GenericModel, typing.Generic[T]):
data: List[T]
class PaginatedResponseModel(ResponseModel[T]):
total_count: int
ConcreteModel = PaginatedReponseModel[dict] # TypeError: Cannot parameterize a concrete instantiation of a generic model
```
`PaginatedReponseModel` is erroneously considered "concrete" even though type variables are used as parameters, and not concrete types.
It seems GenericModel.__class_getitem__ does not check if any parameters are `TypeVar`, like `typing.Generic` does.
To support generic subclasses, `__class_getitem__` should check if all of the parameters are fully concrete type(i.e. any of them are `typing.TypeVar`s, or any of them are generic types that have non-concrete type parameters). If not, a concrete model should not be created.
I would consider this a bug since it does not follow the behavior of other `typing.Generic` usages, but it could also be a feature request.
Please complete:
* OS: Ubuntu 18.04.1
* Python version `import sys; print(sys.version)`: 3.7.1 (default, Oct 22 2018, 11:21:55)
[GCC 8.2.0]
* Pydantic version `import pydantic; print(pydantic.VERSION)`: `1.0`
author:
url:https://github.com/DrPyser
type:Person
name:DrPyser
datePublished:2019-10-28T23:38:16.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:1
url:https://github.com/947/pydantic/issues/947
context:https://schema.org
headline:GenericModel does not support generic subclasses
articleBody:# Bug
It seems the implementation of pydantic.generics.GenericModel does not support generic subclasses. Example:
```
import pydantic.generics
import typing
T = typing.TypeVar("T")
class ResponseModel(pydantic.generics.GenericModel, typing.Generic[T]):
data: List[T]
class PaginatedResponseModel(ResponseModel[T]):
total_count: int
ConcreteModel = PaginatedReponseModel[dict] # TypeError: Cannot parameterize a concrete instantiation of a generic model
```
`PaginatedReponseModel` is erroneously considered "concrete" even though type variables are used as parameters, and not concrete types.
It seems GenericModel.__class_getitem__ does not check if any parameters are `TypeVar`, like `typing.Generic` does.
To support generic subclasses, `__class_getitem__` should check if all of the parameters are fully concrete type(i.e. any of them are `typing.TypeVar`s, or any of them are generic types that have non-concrete type parameters). If not, a concrete model should not be created.
I would consider this a bug since it does not follow the behavior of other `typing.Generic` usages, but it could also be a feature request.
Please complete:
* OS: Ubuntu 18.04.1
* Python version `import sys; print(sys.version)`: 3.7.1 (default, Oct 22 2018, 11:21:55)
[GCC 8.2.0]
* Pydantic version `import pydantic; print(pydantic.VERSION)`: `1.0`
author:
url:https://github.com/DrPyser
type:Person
name:DrPyser
datePublished:2019-10-28T23:38:16.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:1
url:https://github.com/947/pydantic/issues/947
Person:
url:https://github.com/DrPyser
name:DrPyser
url:https://github.com/DrPyser
name:DrPyser
InteractionCounter:
interactionType:https://schema.org/CommentAction
userInteractionCount:1
interactionType:https://schema.org/CommentAction
userInteractionCount:1
External Links {π}(2)
Analytics and Tracking {π}
- Site Verification - Google
Libraries {π}
- Clipboard.js
- D3.js
- Lodash
Emails and Hosting {βοΈ}
Mail Servers:
- aspmx.l.google.com
- alt1.aspmx.l.google.com
- alt2.aspmx.l.google.com
- alt3.aspmx.l.google.com
- alt4.aspmx.l.google.com
Name Servers:
- dns1.p08.nsone.net
- dns2.p08.nsone.net
- dns3.p08.nsone.net
- dns4.p08.nsone.net
- ns-1283.awsdns-32.org
- ns-1707.awsdns-21.co.uk
- ns-421.awsdns-52.com
- ns-520.awsdns-01.net