But doesn't date.strftime returns str not Any:
https://github.com/python/typeshed/blob/main/stdlib/datetime.pyi#L75 ?
Damian
On Thu, Mar 23, 2023 at 10:00 PM Will Bradley
wrote:
> This is some real code I wrote the other day:
> payload = {
> "birthDate": str(date.strftime('%m/%d/%Y')),
> ...
>
Can you give some examples of how it would be used differently than the
current modulo operator and what value it would bring?
For those who have not taken number theory courses in a long time (or
never!) it's not clear how this would be useful for Python.
Damian (he/him)
On Fri, Mar 18, 2022
That sounds like a lot of extra checks to put on "/" when the error message
is clear and the user could implement their own checks if they are running
into this niche use case and do 10**400 / int(1e200).
Damian (he/him)
On Sat, Feb 19, 2022 at 8:36 AM Stefan Pochmann
wrote:
> It crashes
FYI there was a patch for this in the past and it was rejected:
https://bugs.python.org/issue21301
Damian (he/him)
On Thu, Feb 10, 2022 at 12:04 PM Christopher Barker
wrote:
> +1 -- I would really like pathlib to be able to used for everything one
> would need to do with paths.
>
> -CHB
>
>
>
This was very recently discussed at length:
https://mail.python.org/archives/list/python-...@python.org/thread/YB2JD477TKPB2HTXDW6ZXUBD6NFFFHHJ/#YB2JD477TKPB2HTXDW6ZXUBD6NFFFHHJ
Damian (he/him)
On Thu, Feb 3, 2022 at 11:51 AM Abdur-Rahmaan Janhangeer <
arj.pyt...@gmail.com> wrote:
> Greetings,
I find this approach too cryptic compared to reading regular Python
notation, my brain has to mode switch to make sense of it. Would a little
extra ?: be too much add to make clear it's a lambda function, e.g.
?: ? > 0 instead of ? > 0
Also either approach *could *add multi-argument lambdas:
?1,
Is there a reason you defined it as n * math.gamma(n), instead of
math.gamma(n+1)?
Damian (he/him)
On Thu, Sep 16, 2021 at 2:35 PM Jonatan wrote:
> Currently, math.factorial only supports integers and not floats, whereas
> the "mathematical" version supports both integers and floats.
> I.e:
>
I am not convinced of tying `backticks` for a single markup language.
Different markup languages presumably have different escape methods? Is
Python supposed to be explicitly an HTML based language like many of the
design choices of JavaScript?
It also seems like a lot to ask to introduce yet
In your code example it looks like FastAPI is making 1 HTTP request vs.
your library is making 3 HTTP requests? Or are there some missing lines? Or
am I missing something?
Also are you referring to https://github.com/pyopenapi/pyopenapi ? And if
so what would be the reasoning to pull something
Is there somewhere where you can use "*ab" but not "a ,b" currently in
Python?
On Fri, Jun 18, 2021 at 11:43 AM Mathew Elman
wrote:
> I don't see how allowing
>
> [x, y for x in a]
>
> follows from allowing
>
> [*chunk for chunk in list_of_lists].
>
that runs in a shell to behave the same in a script, and
> vice-versa. But, if `_` is both a variable (shell) and a keyword (`match`),
> that 's not the case. You have to work around the problem, e.g. by
> reaffecting `_`.
> My fear is that most people (me included) will most likely forget this
It's still a Python feature even if it's not a language feature, it's well
defined by PEP and any type checker wanting to implement type hinting to
spec must include it.
Further type hinting allows developers who want to use a Constant / Final
feature get the benefit already from type hinting,
FYI,
Something very similar already exists in the standard library,
contextlib.suppress:
https://docs.python.org/3/library/contextlib.html#contextlib.suppress
It makes a nice 2+ liner for a lot of situations:
with suppress(Exception):
...
Seems more flexible than OPs keyword suggestion as
Typeguard provides this functionality:
https://typeguard.readthedocs.io/en/latest/userguide.html
It's not perfect but that's because runtime type hints have lots of
restrictions on what can be reasoned about them. But for simple and common
cases it works very well.
--
Damian (he / him)
On Sun,
14 matches
Mail list logo