> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-ide
>> Python Language Consulting
>> - Teaching
>> - Scientific Software Development
>> - Desktop GUI and Web Development
>> - wxPython, numpy, scipy, Cython
>> ___
>> Python-ideas mailing list -- python-ideas@python.org
>>
sier to find the default values, to count the parameters,
etc..
--
Danilo J. S. Bellini
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python
lp messages documentation (e.g. to avoid showing just a "**kwargs" when
the valid keyword arguments can be grabbed from the function that uses
them).
Regards,
Danilo J. S. Bellini
---
"*It is not our business to set up prohibitions, but to arrive at
conventions.*" (R. Ca
lt PYTHONSTARTUP file name in Python 3.7.3, or at least a
single global configuration file for the REPL where I can put that oneliner
or a file reference with that line? I strongly prefer not to mess around
with ~/.bashrc, ~/.zshrc and scattered stuff like that, if possible.
--
Danilo J. S.
quot; with unmatched
parentheses, because the "something" was filled by a TAB completion, and
the trailing open parenthesis wasn't expected (given that there's no such a
completion elsewhere).
--
Danilo J. S. Bellini
---
"*It is not our business to set up prohibition
that uses "next" in its body. But I can't do that
to all packages from other people, and having to change/monkeypatch
imported stuff in order to keep it working in this new Python version is
getting annoying already.
Perhaps adding a new kwarg to the "next" built-in to cho
siveness towards people who already know the concepts
that should be emphasized, not some other arbitrary "simplification" goal
(e.g. minimize the number of characters, only use English, ...).
IMHO, avoiding jargon sounds like avoiding teaching. In the case of new
Python stuff, avoiding the s
aware that it might be slow.
The alternatives are:
- exact, unbounded: Slower test
- not exact, unbounded: Probabilistic test
- exact, bounded: Default, raises OverflowError beyond 2**64
- not exact, bounded: Invalid, but it can just ignore exact input
--
Danilo J.
something else
for that specific error code.
On 31 May 2018 at 06:29, Stephan Houben wrote:
> "[...] The exception matching machinery ignores the __instancecheck__
> mechanism."
>
The __subclasscheck__ gets bypassed, as well.
--
Danilo J. S. Bellini
---
"*It is not our
; try:
... raise Exception("message")
... except Exception as exc:
... print(isinstance(exc, ExceptionHasMessage))
...
True
The idea is to allow catching exceptions beyond checking their MRO,
using a class that checks the exception instance by implementing
a c
gt; issue14384#msg316222 for examples and alternatives).
As attrgetter/itemgetter might get heterogeneus data, I would expect a
per-get default, not [just] a global default.
Perhaps something like:
>>> itemgetter(-1, 0, -2,
...default0="first argument default",
..
1, -2], decay=.1, memory=5))
[5, 4.6, 4.34, 4.206, 3.9854, 3.68686, 3.218174, 2.6963566]
In that example, "y" is the "previous result" (a.k.a. accumulator, or what
had been called "average" here).
--
Danilo J. S. Bellini
---
"*It is not our business to
ds the "scan" feature to Python
comprehensions using a decorator that performs bytecode manipulation (and
it had to fit in with a valid Python syntax): https://github.com/danilobelli
ni/pyscanprev
In that GitHub page I've wrote several examples and a rationale on why this
would be use
ddress/name" and "module" be
1-to-1 concepts (or neither)? How about symbolic links? I'm not sure, but
linking "absolute file name" to "module" sounds like endorsing the
relative-importable-from-external-scripts naming style, and IMHO that's not
the main
tuple(a + b) # -> 0 1 2 3
AudioLazy does that: https://github.com/danilobellini/audiolazy
--
Danilo J. S. Bellini
---
"*It is not our business to set up prohibitions, but to arrive at
conventions.*" (R. Carnap)
___
P
1]))
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
With the "windowed scan" syntax proposal, it would become:
>>> [fibs[-1] + fibs[-2] for unused in range(10) with fibs = [0, 1]]
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
Or:
>>> [fibs[-1] + fibs[-2] for unused in range(10)
2016-11-06 23:55 GMT-02:00 Steven D'Aprano :
> On Sun, Nov 06, 2016 at 04:46:42PM -0200, Danilo J. S. Bellini wrote:
>
> > 1.2. Sub-expressions in an expression might be on other statements (e.g.
> > assignments, other functions).
>
> Not in Python it can't b
2016-11-06 18:00 GMT-02:00 Stephen J. Turnbull <
turnbull.stephen...@u.tsukuba.ac.jp>:
> Danilo J. S. Bellini writes:
>
> > About the effort, do you really find the examples below with the new
> > proposed syntax difficult to understand?
>
> No. I just don'
avior.
For me, the idea I'm proposing is clearly useful. I wanted to use it last
friday to create a function that auto-indents some text based on some
simple rules, and the resulting indentation is the "accumulation" (scan) of
indent/dedent markers. But I couldn't even use itertools
nt.
Brendan, please see the PyScanPrev examples, mainly the Fibonacci and the
State-space model examples. Recursion is enough to give you that. The
proposal isn't about lag and windowing, but if you've got an idea to
improve that, I'd like to know.
2016-10-25 15:55 GMT-02:00 Rob Cli
ame thing as simply spelling it:
>
> accumulate(nums, mul)
>
> Which is even shorter. It's feels very artificially contrived to insist
> that the initial element must live somewhere other than the iterator
> itself. But it would be easy enough to write a wrapper to massage an
> iter
son, but I
wrote a lot about the scan use cases and no one here seem to have read what
I wrote, and the only reason that matters seem to be a kind of social
status, not really "reason". I probably wrote way more reasons for that
proposal than annotations could ever have. But if no on
d.
>
> But if it is indeed just reduce(), then it's even simpler.
>
> ChrisA
> ___
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://pytho
rtools.accumulate in some
sense. The advantages would be:
1 - The scan signature and the functools.reduce signature are the same (the
function as the first parameter, like map/filter)
2 - The module, functools, is the same that has the reduce function
--
Danilo J. S. Bellini
---
"*I
;t paste here any
scan use case because I sent links with several use cases, should I paste
their contents here? The PyScanPrev link (https://github.com/
danilobellini/pyscanprev) has several use case examples (including some
just for a comparison with other possible solutions) and even have a
sary* to get the last item. There's no way
> around that.
>
Not if there's enough information to create the last value. Perhaps on the
it = iter(range(999)) one can get 2 values (call next(it) twice) and
use its __length_hint__ to create the last value. But I think only
sequences sh
you call "sorted" on
endless iterables, it would behave like "last", doesn't it?
The whole point of this idea is the scan as a generator expression or
list/set comprehension that can access the previous iteration output.
Reduce/fold is just the last value of a
function
[2] https://pypi.python.org/pypi/pyscanprev
[3] https://groups.google.com/forum/#!topic/grupy-sp/wTIj6G5_5S0
[4]
https://github.com/danilobellini/pyscanprev/blob/v0.1.0/examples/conditional-toggling.rst
[5]
https://github.com/danilobellini/pyscanprev/blob/v0.1.0/examples/state-space.r
uot;hexdump"
(or any binary file viewer) with decimal output instead of hexadecimal?
I agree that mixing representations for the same abstraction (using decimal
in some places, hexadecimal in other ones) can be a bad idea. Actually,
that makes me believe "decimal unicode codepoint" s
awiam,
> Arkadiusz Bulski
>
>
> ___
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org
inputs (and there would be
some "state" in that "implicit input"). That would also be a great feature
when non-uniform (or external) random number generators are to be used.
This seem to be something that only shuffle gives some control (among the
functions we're t
tools.repeat(container))".
>
> Cheers,
> Nick.
>
> --
> Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia
>
--
Danilo J. S. Bellini
---
"*It is not our business to set up prohibitions, but to arrive at
conventions.*" (R. Carnap)
_
unction at the top of
> your module isn't sufficient.
>
> For what's it is worth, if it were *my* call, I'd accept that the costs
> of adding this are low, but the benefits are just a *tiny* bit higher.
> But that's a judgement call, and if Raymond see t
34 matches
Mail list logo