Dear python enthusiasts,
--(you can skip this part if you're in a hurry)--
4 years ago I was discovering this great language. Already an experienced
software developer and data scientist at that time, accustomed with both
low-level (C++), Object-Oriented (Java), Query (T-SQL), and Script (MATLAB
like it too much when the object to deserialize does not
correspond to the same versions of the classes used.
Best
Sylvain
De : Xavier Combelle
Envoyé : samedi 6 juillet 2019 11:34
À : Sylvain MARIE
Objet : Re: [Python-ideas] Getting the version number for a package or module,
reliably
Dear python enthusiasts,
For some industrial project a few years ago we needed a reliable way to get the
version number for a package or module.
I found out that there was actually no method working in all edge cases,
including:
* Built-in modules
* Unzipped wheels and eggs added to th
19, 2019 at 12:26 PM Greg Ewing
mailto:greg.ew...@canterbury.ac.nz>> wrote:
Sylvain MARIE via Python-ideas wrote:
> `my_decorator(foo)` when foo is a callable will always look like
> `@my_decorator` applied to function foo, because that's how the language is
> designed.
I don't t
2019 04:56
À : Sylvain MARIE
Cc : David Mertz ; python-ideas
Objet : Re: [Python-ideas] Problems (and solutions?) in writing decorators
[External email: Use caution with links and attachments]
________
Sylvain MARIE via Python-ideas writes:
> I totally und
ds
Sylvain
De : David Mertz
Envoyé : mardi 12 mars 2019 19:15
À : Sylvain MARIE
Cc : Steven D'Aprano ; python-ideas
Objet : Re: [Python-ideas] Problems (and solutions?) in writing decorators
[External email: Use caution with links and attachments]
One of
on-existent need ;)
Kind regards
--
Sylvain
De : David Mertz
Envoyé : mardi 12 mars 2019 15:30
À : Sylvain MARIE
Cc : Steven D'Aprano ; python-ideas
Objet : Re: [Python-ideas] Problems (and solutions?) in writing decorators
[External email: Use caution with links and attachments]
___
David
I realize that you were pointing at the 'wrapt' library not the
functools.wrapt library.
>From what I have tried with that library, it does not solve the issue solved
>with decopatch.
Sylvain
-Message d'origine-----
De : Sylvain MARIE
Envoyé : mardi 12 mars
) in writing decorators
[External email: Use caution with links and attachments]
On Tue, Mar 12, 2019 at 09:36:41AM +, Sylvain MARIE via Python-ideas wrote:
> I therefore proposed
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fs
Dear python enthusiasts,
Writing python decorators is indeed quite a tideous process, in particular when
you wish to add arguments, and in particular in two cases : all optional
arguments, and one mandatory argument. Indeed in these two cases there is a
need to disambiguate between no-parenthes
hon.org
Cc : Sylvain MARIE ; Python-Ideas
Objet : Re: [Python-ideas] Boolean ABC similar to what's provided in the
'numbers' module
Guido van Rossum writes:
> Hm, perhaps Integral is an adjective, just like Boolean?
I would guess so. This is the same idiom we use when w
@noaa.gov]
Envoyé : vendredi 16 février 2018 22:42
À : gu...@python.org
Cc : Sylvain MARIE ; Python-Ideas
Objet : Re: [Python-ideas] Boolean ABC similar to what's provided in the
'numbers' module
Sent from my iPhone
> A thought just occurred to me. Maybe we should just add a Boolea
ut maybe that’s too
much of type checking for the python philosophy ? I’m wondering if we’re going
too far here…
Anyway, again, my point is just about consistency: if this is available for
numbers, why not for simple Booleans?
Sylvain
De : Guido van Rossum [mailto:gvanros...@gmail.com]
Envoyé : me
, pytypes) are not dependent on MyPy.
Sylvain
De : gvanros...@gmail.com [mailto:gvanros...@gmail.com] De la part de Guido van
Rossum
Envoyé : mercredi 14 février 2018 19:47
À : Sylvain MARIE
Cc : python-ideas
Objet : Re: [Python-ideas] Boolean ABC similar to what's provided in the
'numbe
The main use case I had in mind was PEP484-based type hinting/checking actually:
def my_function(foo: Boolean):
pass
explicitly states that my_function accepts any Boolean value, whether it is a
python bool or a np.bool that would come from a numpy array or pandas dataframe.
Note that type h
My point is just that today, I use the ‘numbers’ package classes (Integral,
Real, …) for PEP484 type-hinting, and I find it quite useful in term of input
type validation (in combination with PEP484-compliant type checkers, whether
static or dynamic). Adding a Boolean ABC with a similar behavior
The numbers module provides very useful ABC for the 'numeric tower', able to
abstract away the differences between python primitives and for example numpy
primitives.
I could not find any equivalent for Booleans.
However numpy defines np.bool too, so being able to have an abstract Boolean
class
George
For what’s worth if it can help for your need – I know that this is not part of
the dataclasses PEP – inheritance now works with @autoclass
(https://smarie.github.io/python-autoclass/ ), as demonstrated below.
Note that unfortunately for mutable default field values you still have to
per
> I haven't yet seen any justification for syntax here. The nearest I've seen
> is that this "ensure" action is more like:
>
> try:
> cond = x >= 0
> except BaseException:
> raise AssertionError("x must be positive")
> else:
> if not cond:
> raise AssertionError("x must be posi
ption, it will not be
caught by 'assert_valid', therefore the ValidationError will not be raised. So
this is not what I want as an application developer.
--
Sylvain
-Message d'origine-
De : Paul Moore [mailto:p.f.mo...@gmail.com]
Envoyé : mardi 16 janvier 2018 18:01
20 matches
Mail list logo