New submission from Sylvain Marie :
The example in the doc shows
```python
>>> import locale
>>> loc = locale.getlocale() # get current locale
# use German locale; name might vary with platform
>>> locale.setlocale(locale.LC_ALL, 'de_DE')
>>>
Sylvain Marie added the comment:
For future reference if this topic re-opens, there is now an alternative here:
https://smarie.github.io/python-makefun/#removing-parameters-easily
Note: it relies on a dynamic `compile` statement so of course it is less
optimal than the one in functools. But
Sylvain Marie added the comment:
Quick update on this feature: for the following example to work:
from inspect import is_decorator_call
def set_hello_tag(tag='world'):
if is_decorator_call():
# called without parenthesis!
# the decorated object is `tag`
Sylvain Marie added the comment:
+1 on this, I am totally in line with the original post.
The / operator semantics should not imply any notion of drive or of "cd"
command on a shell. It should simply stick to "concatenate", i.e. "create child
path" (and actual
New submission from Sylvain Marie :
Python decorators are frequently proposed by libraries as an easy way to add
functionality to user-written functions: see `attrs`, `pytest`, `click`,
`marshmallow`, etc.
A common pattern in most such libraries, is that they do not want to provide
users
Sylvain Marie added the comment:
Very much interested by the topic.
For reference I tried to summarize the status of inline type and value
validation here: https://smarie.github.io/python-valid8/why_validation/
And I proposed a solution with a library here
https://smarie.github.io/python
New submission from Sylvain Marie :
This issue is created following the discussion [Python-ideas] Boolean ABC
similar to what's provided in the 'numbers' module.
The following items are suggested:
- adding a 'Boolean' ABC class to the 'numbers' module
-
Sylvain Marie added the comment:
Thanks !
1. > ok
2. > ok
3. > That's simply 'the latest state' in the discussion. I guess that having
Boolean in numbers is better than it being in its own module, since it is
consistent with the other ABCs (and bool is a subc
Sylvain Marie added the comment:
@Mark: you are right. That's why the proposed ABC does NOT inherit from
Integral/Integer and focuses on boolean logic in its simplest form (not, and,
or, xor). This one is common to both python bool and np.bool_.
@Serhiy: thanks for this intere
Sylvain Marie added the comment:
@Mark : the '__invert__' method is out of the game since Josh comment (and my
reply https://bugs.python.org/issue32886#msg312478 )
So the remaining operations *are* an abstraction of both python bool and numpy
bool_ behaviour (and a minimal represe
Change by Sylvain Marie :
Added file: https://bugs.python.org/file47457/proposal.py
___
Python tracker
<https://bugs.python.org/issue32886>
___
___
Python-bugs-list mailin
Sylvain Marie added the comment:
Mark
I get your point.
Mine is just to have a common abstraction between python's primitive bool and
numpy bool (and possibly other future alternate booleans) for consistency with
`numbers` and to be used in common type hints (PEP484).
If I ge
12 matches
Mail list logo