Files
pydantic/tests
Levi Naden 61c8ca2f30 Re-enable nested model init calls while still allowing self (#644)
* Re-enable nested model init calls while still allowing self

This commit enables nested model `__init__` statements to be executed
while still allowing `self` as an argument.

Effectively reverses the changes from #632 while still enabling the
feature it implemented. In theory, there will still be a collision if
someone ever tried to use `pydantic_base_model/settings_init` as an arg,
but I don't know how to engineer a case where a collision would *never*
happen, I'm not sure there is one.

This commit also added a test for both BaseModel` and `BaseSettings` for
both the `self`-as-a-parameter and the nested `__init__` features since
`BaseSettings` now has the same issue as `BaseModel` since it invoked
an `__init__` with self.

I have added a comment under the `__init__` for both `BaseModel` and
`BaseSetting` since not having `self` as the first arg is such a
rarity within Python that it will likely confuse future developers who
encounter it.

The actual name of the variable referencing the class itself can be
up for debate.

* Please Lint

* Please Black

* Update from comments
2019-07-11 15:42:48 +02:00
..
2017-05-03 22:23:41 +01:00
2019-05-30 12:04:15 +01:00
2019-02-04 21:54:20 +00:00
2019-02-04 21:54:20 +00:00
2019-06-21 12:32:03 +01:00
2019-05-22 13:14:35 +01:00
2019-05-30 12:04:15 +01:00
2019-06-04 17:06:08 +01:00
2019-07-06 09:52:42 +01:00
2019-07-06 09:52:42 +01:00