135201
You will be muted until you read the rules. Read them! @Rules_for_Python A group about the Python programming language. Offtopic things go here: @pythonofftopic Resources to learn python: @pythonres Group for Hy: @hylang Selenium: @SeleniumPython
why library i listen we should to do
Decimal("0.1") + Decimal("0.2")
In a windows computer, as any other program, you download the installer, open it and follow the assistant
Читать полностью…
Mildred Raines, please verify you are human by clicking the button below. You have 90 seconds.
Читать полностью…
Jokes are better made at @pythonofftopic. It's better not to make jokes here. Be sure to delete this very funny joke.
Читать полностью…
Don’t Assume Floating-Point Numbers Are Perfectly Accurate
https://inventwithpython.com/beyond/chapter8.html
why python gives 0.30000000000000004 when adding 0.1 + 0.2
Читать полностью…
You can, but that's bad practice and domain is about your business logic and that's, I think, strange to validate something here
And you need to map models to your ORM (or whatever you use) models probably, and dataclasses is better here
Pydantic here is like using ladle where you can use spoon
so i though pydantic's BaseModel will replace the my core python things what do you say will thsi really bad to use Pydantic's models here for store data and pass to another places
Читать полностью…
i think a have already saw type as a keyword... what exactly means?
Читать полностью…
Can anyone help me with python's technology to build an ai driven app
Читать полностью…
i means, as he says we will use library here for this!!!
but i found normally with the Decimal we can solve the float problem. so ehat rhe library be say to use
That's the case with all programming languages
Floating numbers are handled with a binary representation, so there will be an overflow at times
There are libraries designed to handle that though
But if you know problems that can cause this decision and if you can bear upon with it - you can use pydantic, that's legal for pragmatic architecture
I've used ORM in domain entities and that's ok if you know what you are doing (https://github.com/MagM1go/marionette/blob/main/src/marionette/domain/entities/character.py)
https://github.com/MagM1go/marionette/blob/main/README_en.md
No external dependencies in domain. Dataclass is better here
Читать полностью…
See i want to store some data and then retrive those, so what do you say about this,
class OTPPolicy(
BaseModel,
frozen=True,
):
validity_seconds: int = Field(
gt=0,
)
cooldown_seconds: int = Field(
gt=0,
)
max_attempts: int = Field(
gt=0,
)
length: int = Field(
gt=0,
lt=100,
)
Vs Below -> Also i then listen there is:
@dataclass(frozen=True)
class OTPPolicy:
validity_seconds: int
cooldown_seconds: int
max_attempts: int
length: int
Use type Vector = list[float] for Python 3.12+ and
Vector: TypeAlias = list[float]
Vector = list[float] at all.
Читать полностью…