pydantic / pydantic-extra-types

Extra Pydantic types.
MIT License
176 stars 47 forks source link

pendulum.DateTime instantiation from dt.datetime #158

Closed docek closed 3 months ago

docek commented 5 months ago

https://github.com/pydantic/pydantic-extra-types/issues/139

docek commented 5 months ago

Can we add a test for it?

Definitely, I have very quickly tried to add few lines on GitHub, but the merge tests did not go through because the "Import block is un-sorted or un-formatted". To be honest, I do not see where is the problem.

mikenerone commented 4 months ago

Is there any reason the analogous changes shouldn't be applied to Date (accepting datetime.date objects) and Duration (accepting datetime.timedelta objects)? I currently do these in my local enhancements. It seems to me like pretty inconsistent behavior without these.

07pepa commented 3 months ago

@yezz123 this can be closed already present here with test and merged https://github.com/pydantic/pydantic-extra-types/pull/176