Bart wrote:
a[1],b[fn()] = b[fn()],a[1]
I suppose if you find yourself doing heaps of swaps with
complicated indexes it could be useful to have a swap
primitive. In my experience it's a pretty rare thing to
want to do, though.
Also it only covers one special case of all possible
permutations.
iansuder...@gmail.com writes:
> What does the code look like to insert assembler into python and how does
> that code send information back to python.
Python is a "high level" language: it tries hard to hide many
"low level" details such as addresses and memory management.
Thus, it is quite far
On Wed, Jun 20, 2018 at 11:19 AM, Steven D'Aprano
wrote:
> On Wed, 20 Jun 2018 07:52:31 +1000, Chris Angelico wrote:
>
>>> What do you do in python when a local function variable needs to retain
>>> its value? I'm sure it can do it, but I bet it's not as simple as how I
>>> do it.
>>>
>> What do y
On Tue, 19 Jun 2018 12:13:40 -0700, Jim Lee wrote:
> On 06/19/2018 04:13 AM, Ed Kellett wrote:
>> I think
>> we're all--still--missing the larger point that "easy to remove" is a
>> completely stupid metric for judging language features. Seriously. Not
>> a little bit stupid.
>
> Not if you think
On Tue, 19 Jun 2018 12:38:24 -0700, Rick Johnson wrote:
> Why shouldn't i have the right to "brush type-hints under the rug" Ian?
> After all, if the code *I* write doesn't belong to *ME*, well then, who
> *HELL* does it belong to?
If you don't want to use type-hints in your own code, why did you
> > Secondly, I don't understand how curve_fit knows the number of arguments
> > that test_func takes.
>
> Part of the dynamic nature of Python is that a function carries with it
> the number of parameters (as just one among many such properties). We
> call it "introspection" when we examine s
On Tue, Jun 19, 2018 at 7:33 PM, Steven D'Aprano <
steve+comp.lang.pyt...@pearwood.info> wrote:
> On Tue, 19 Jun 2018 17:41:11 -0700, iansuderman wrote:
>
> > What does the code look like to insert assembler into python and how
> > does that code send information back to python.
> >
> > It seems y
On Tue, 19 Jun 2018 17:41:11 -0700, iansuderman wrote:
> What does the code look like to insert assembler into python and how
> does that code send information back to python.
>
> It seems you wrote that python is a good compiler for assembly. If
> possible I want to add assembly to my python.
On Wed, 20 Jun 2018 07:52:31 +1000, Chris Angelico wrote:
>> What do you do in python when a local function variable needs to retain
>> its value? I'm sure it can do it, but I bet it's not as simple as how I
>> do it.
>>
> What do you mean, "retain its value"? Do you mean the way closures work?
I
Terry Reedy at 2018/6/19 PM 08:35 wrote:
On 6/18/2018 8:38 PM, sa...@caprilion.com.tw wrote:
Grant Edwards at 2018/6/18 PM 10:36 wrote:
On 2018-06-17, Jach Fong wrote:
The "address" of the Font object 'TkDefaultFont' changes, why?
What makes you think it's the same object the second time an
On Tue, 19 Jun 2018 14:07:32 -0700, bart4858 wrote:
> Do you think that a feature like swap(x,y) literally only works on two
> simple variables?
I think that if you write "x" and "y", you mean placeholder names that
stand in for arbitrary variable names, not expressions. That's the common
and u
What does the code look like to insert assembler into python and how does that
code send information back to python.
It seems you wrote that python is a good compiler for assembly. If possible I
want to add assembly to my python.
--
https://mail.python.org/mailman/listinfo/python-list
Some of that can be done. It may not need specific support.
But my intention is to have an ordinary language for everyday coding not one
that can only be understood by CS professors.
Mine is unusual in that I can drop features I rarely use, which means that
everything in it gets good use. Inclu
On Wed, Jun 20, 2018 at 8:14 AM, wrote:
> Features? Important ones? Go back 40 years and see how important they were
> then. Most of them,nobody had heard of, and would not be meaningful.
>
Let's see. Forty years ago was 1978. Databasing was a little bit
important. I mean, not much... just that
Features? Important ones? Go back 40 years and see how important they were
then. Most of them,nobody had heard of, and would not be meaningful.
Now do the same with my list - most are programming features that could be
understood and appreciated even then.
Finally, imagine going forward 40 year
On Wed, Jun 20, 2018 at 7:41 AM, wrote:
> I think you're getting a programming language mixed up with a bunch of random
> libraries.
>
> If you want to do any actual coding rather than scripting, such as
> implementing some of that stuff, then this is where those basic language
> features that
I think you're getting a programming language mixed up with a bunch of random
libraries.
If you want to do any actual coding rather than scripting, such as implementing
some of that stuff, then this is where those basic language features that are
missing from core Python become useful.
What do
On Wed, Jun 20, 2018 at 7:07 AM, wrote:
> Do you think that a feature like swap(x,y) literally only works on two simple
> variables? X and y represent any two lvalue expressions. For example, a[I]
> and a[I+1]. Python will evaluate each twice.
>
> My version sets up two references then exchange
Do you think that a feature like swap(x,y) literally only works on two simple
variables? X and y represent any two lvalue expressions. For example, a[I] and
a[I+1]. Python will evaluate each twice.
My version sets up two references then exchanges what they point to with one
bytecode.
--
Bart
On Tue, Jun 19, 2018 at 1:42 PM Rick Johnson
wrote:
>
> On Tuesday, June 19, 2018 at 1:02:52 PM UTC-5, Ian wrote:
> > On Mon, Jun 18, 2018 at 2:57 PM Rick Johnson
> > It's a "burden" (actually, a helpful tool) to the
> > programmer either way: whether it's in a comment or an
> > annotation, it's t
On Wed, Jun 20, 2018 at 5:38 AM, Rick Johnson
wrote:
>> You've been answered time and time again -- the devs are
>> volunteers and are not beholden to do whatever you want
>> just because you don't like it -- yet for some reason you
>> keep asking.
>
> Are you a dev?
>
> Is Chris a Dev?
>
> Is Ste
On Tuesday, June 19, 2018 at 1:02:52 PM UTC-5, Ian wrote:
> On Mon, Jun 18, 2018 at 2:57 PM Rick Johnson
[...]
> > The point is, from the POV of the interpreter and the
> > programmer. comments are always going to be comments
> > regardless of whether special purpose tools parse them or
> > not. An
On 06/19/2018 04:13 AM, Ed Kellett wrote:
I think
we're all--still--missing the larger point that "easy to remove" is a
completely stupid metric for judging language features. Seriously. Not a
little bit stupid.
Not if you think of the feature as analogous to cancer.
-Jim
--
https://mail.py
On 2018-06-19, Steven D'Aprano wrote:
> I know that Rick's attitude towards reality is that facts are only for
> other people, and that once he has made up his mind nothing will budge
> it, *especially* not facts, but for anyone reading this who might be
> fooled into imagining that Rick has a
On 19/06/18 18:10, Ian Kelly wrote:
On Tue, Jun 19, 2018 at 3:14 AM Steven D'Aprano
wrote:
On Mon, 18 Jun 2018 10:01:58 -0700, Rick Johnson wrote:
Steven D'Aprano wrote:
[...]
particular at DropBox, which is (I believe) funding a lot of Guido's
time on this, because they need it.
And now
On Mon, Jun 18, 2018 at 2:57 PM Rick Johnson
wrote:
>
> On Monday, June 18, 2018 at 2:48:58 PM UTC-5, Ian wrote:
> > I would also note that none of this applies to type hinting
> > in any case. Type hints don't require the programmer to be
> > able to explain anything in natural language, nor are
On Tuesday, June 19, 2018 at 4:12:10 AM UTC-5, Steven D'Aprano wrote:
[...]
> People have been requesting static typing in Python virtually since Day
> 1,
"Day one"???
Really?
"People"???
How many people?
Contrary to to your fuzzy memories, Steven, we all know that Guido _purposely_
desig
On Tue, Jun 19, 2018 at 3:14 AM Steven D'Aprano
wrote:
>
> On Mon, 18 Jun 2018 10:01:58 -0700, Rick Johnson wrote:
>
> > Steven D'Aprano wrote:
> > [...]
> >> particular at DropBox, which is (I believe) funding a lot of Guido's
> >> time on this, because they need it.
> >
> > And now we get to the
On Mon, 18 Jun 2018 10:34:54 -0700, Jim Lee wrote:
> The syntax should be defined inside comments
Then you ought to be pleased that from Python 4.0 (or from Python 3.7
with a ``__future__`` import) annotations will be treated as strings by
the interpreter.
That makes them effectively special c
On 18 June 2018 at 22:18, Etienne Robillard wrote:
> Hi,
>
> Quick question: Does anyone of you know what is the effect of enabling
> gc.enable() in sitecustomize.py when using PyPy? Can it reduce latency for
> long-lived WSGI applications?
>
gc is enabled by default. you only need to use gc.ena
Rhodri James wrote:
[...]
> It has little flea executioners running around with little flea axes
> chopping off little flea heads?
Hmm. And who knew that Python-list was really just a homicidal flea circus. Go
figure!
--
https://mail.python.org/mailman/listinfo/python-list
On Tuesday, June 19, 2018 at 5:21:25 AM UTC-5, Chris Angelico wrote:
> On Tue, Jun 19, 2018 at 8:12 PM, Steven D'Aprano
> wrote:
> > On Mon, 18 Jun 2018 11:34:40 -0700, Jim Lee wrote:
> >
> >> On 06/18/2018 11:18 AM, Chris Angelico wrote:
> >>> What, fundamentally, is the difference between type h
This is a Python forum, but what you are asking is not a Python
question. You might find a better source of answers on a scipy specific
forum.
But here's my attempt at answers:
On 06/19/2018 08:26 AM, sharan.basa...@gmail.com wrote:
Hi All,
I am working out an exercise on curve_fit functi
On Tue, 19 Jun 2018 11:52:22 +0100, Bart wrote:
> On 19/06/2018 11:33, Steven D'Aprano wrote:
>> On Tue, 19 Jun 2018 10:19:15 +0100, Bart wrote:
>>
>>> * Swap(x,y) (evaluate each once unlike a,y=y,x)
>>
>> Sigh. Really? You think x,y = y,x evaluates x and y twice?
>
> Yes.
Well, you would be w
Hi All,
I am working out an exercise on curve_fit function available scipy package.
While I understand in general about curve_fit, I am unable to understand the
following:
params, params_covariance = optimize.curve_fit(test_func, x_data, y_data,
p0
On Tue, 19 Jun 2018 12:13:30 +0100, Ed Kellett wrote:
> I think
> we're all--still--missing the larger point that "easy to remove" is a
> completely stupid metric for judging language features. Seriously. Not a
> little bit stupid.
+1
--
Steven D'Aprano
"Ever since I learned about confirmation
On 6/18/2018 8:38 PM, sa...@caprilion.com.tw wrote:
Grant Edwards at 2018/6/18 PM 10:36 wrote:
On 2018-06-17, Jach Fong wrote:
C:\Python34\Doc>py
Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32
bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for
On Tue, Jun 19, 2018 at 9:33 PM, Rhodri James wrote:
> On 18/06/18 21:39, Chris Angelico wrote:
>>
>> On Tue, Jun 19, 2018 at 6:25 AM, Rick Johnson
>> wrote:
>>>
>>> Chris Angelico wrote:
>>> [...]
assert """
, ", ";print('Will I print?');\
"';print("Or will I?");\
';
On 18/06/18 21:39, Chris Angelico wrote:
On Tue, Jun 19, 2018 at 6:25 AM, Rick Johnson
wrote:
Chris Angelico wrote:
[...]
assert """
, ", ";print('Will I print?');\
"';print("Or will I?");\
';print("What about me?");'''\
print("And me? Where endeth");"""\
print('the assertion?');\
Ch
On Tue, Jun 19, 2018 at 9:07 PM, Bart wrote:
> On 19/06/2018 11:45, Chris Angelico wrote:
>>
>> On Tue, Jun 19, 2018 at 8:33 PM, Steven D'Aprano
>> wrote:
>>>
>>> Yeah, I get it, you like your language to have lots and lots and lots of
>>> syntax to do *slightly* different things. But it doesn't
On 2018-06-19 11:21, Chris Angelico wrote:
> Isn't it nice how comments, being terminated exclusively by
> end-of-line, allow the introduction of subtle bugs? Let's see how many
> people spot the (presumably deliberate) bug in Steve's code here.
Hardly subtle.
It does also make them considerably
On 19/06/2018 11:45, Chris Angelico wrote:
On Tue, Jun 19, 2018 at 8:33 PM, Steven D'Aprano
wrote:
Yeah, I get it, you like your language to have lots and lots and lots of
syntax to do *slightly* different things. But it doesn't seem to be so
good at doing application level functionality. Its b
On Tue, Jun 19, 2018 at 8:52 PM, Bart wrote:
> On 19/06/2018 11:33, Steven D'Aprano wrote:
>>
>> On Tue, 19 Jun 2018 10:19:15 +0100, Bart wrote:
>>
>>> * Swap(x,y) (evaluate each once unlike a,y=y,x)
>>
>>
>> Sigh. Really? You think x,y = y,x evaluates x and y twice?
>
>
> Yes. Try:
>
> count=0
>
On 19/06/2018 11:33, Steven D'Aprano wrote:
On Tue, 19 Jun 2018 10:19:15 +0100, Bart wrote:
* Swap(x,y) (evaluate each once unlike a,y=y,x)
Sigh. Really? You think x,y = y,x evaluates x and y twice?
Yes. Try:
count=0
def fn():
global count
count=count+1
return 1
a
Python Training in Bangalore Best Python Training Courses in Bangalore –
Marathahalli, BTM Layout, Rajajinagar & Jaya Nagar. We train the students from
basic level to advanced concepts with a real-time environment. We are the Best
Python Training Institute in bangalore.
URL :
https://www.be
On Tue, Jun 19, 2018 at 8:33 PM, Steven D'Aprano
wrote:
> Yeah, I get it, you like your language to have lots and lots and lots of
> syntax to do *slightly* different things. But it doesn't seem to be so
> good at doing application level functionality. Its basically just a less
> efficient, slight
On Tue, 19 Jun 2018 10:19:15 +0100, Bart wrote:
> * Swap(x,y) (evaluate each once unlike a,y=y,x)
Sigh. Really? You think x,y = y,x evaluates x and y twice?
The rest of your list seemed like a very nice list of low-level
operations, if you want a low-level language with lots of redundancy and
Le 19/06/2018 à 11:47, Peter Otten a écrit :
ast wrote:
Le 19/06/2018 à 10:57, Peter Otten a écrit :
ast wrote:
No, with dt = 100 it should last
200 * 100ms = 20.000ms = 20s
with dt = 0.1 it should last
200 * 0.1ms = 20ms = 0.02s
but your computer is probably not fast enough for that
On Tue, Jun 19, 2018 at 8:12 PM, Steven D'Aprano
wrote:
> On Mon, 18 Jun 2018 11:34:40 -0700, Jim Lee wrote:
>
>> On 06/18/2018 11:18 AM, Chris Angelico wrote:
>>> What, fundamentally, is the difference between type hints and
>>> assertions, such that - in
>>> your view - one gets syntax and the o
On Mon, 18 Jun 2018 11:34:40 -0700, Jim Lee wrote:
> On 06/18/2018 11:18 AM, Chris Angelico wrote:
>> What, fundamentally, is the difference between type hints and
>> assertions, such that - in
>> your view - one gets syntax and the other is just comments?
> Type hints are just that - hints. They
On Tue, Jun 19, 2018 at 7:19 PM, Bart wrote:
> My own dynamic language is much smaller than Python, much less dynamic, much
> less extendable, and lower level.
>
> Yet it might have a dozen highly useful features, ones I consider basic,
> that are already built-in and Just Work without having to g
ast wrote:
> Le 19/06/2018 à 10:57, Peter Otten a écrit :
>> ast wrote:
>>
>>> I noticed that the speed of animations made
>>> with module matplotlib.animation always seems
>>> wrong.
>>
>>> dt = 0.1 # 100 ms
>>
>>> interval : number, optional
>>>
>>> Delay between frames in millisecon
On Mon, 18 Jun 2018 13:52:24 -0700, Rick Johnson wrote:
> I have asked time and time again for someone to directly justify why
> py-dev won't offer a tool to remove the interleaved type-hint syntax
> from scripts.
You say that as if the core developers were obligated to cater to your
every idle
Jim Lee at 2018/6/19 PM 03:44 wrote:
On 06/18/2018 09:22 PM, Jach Fong wrote:
Ben Finney at 2018/6/19 PM 10:20 wrote:
Jach Fong writes:
Although it passed the first examination, I have no idea if it can
work correctly in the real application:-)
Neither do I. What is the real-world proble
Steven D'Aprano wrote:
The animation should last 20s, but on my computer it is twice faster
Try replacing your CPU with one half as fast.
Or push the Turbo button to slow it down to 4.77MHz.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
Le 19/06/2018 à 10:57, Peter Otten a écrit :
ast wrote:
I noticed that the speed of animations made
with module matplotlib.animation always seems
wrong.
dt = 0.1 # 100 ms
interval : number, optional
Delay between frames in milliseconds. Defaults to 200.
What's wrong ?
From t
On 19/06/2018 06:08, Chris Angelico wrote:
On Tue, Jun 19, 2018 at 1:46 PM, Dan Stromberg wrote:
Great languages are small but extensible, easy to read, and don't require
learning a lot before you can get started writing code or reading someone
else's code.
Great languages: C and Scheme. And
On Mon, 18 Jun 2018 10:01:58 -0700, Rick Johnson wrote:
> Steven D'Aprano wrote:
> [...]
>> particular at DropBox, which is (I believe) funding a lot of Guido's
>> time on this, because they need it.
>
> And now we get to the truth!
>
> Guido's new puppet master is the sole reason why this fine
ast wrote:
> I noticed that the speed of animations made
> with module matplotlib.animation always seems
> wrong.
> dt = 0.1 # 100 ms
> interval : number, optional
>
> Delay between frames in milliseconds. Defaults to 200.
>
>
> What's wrong ?
>From the above I would conclude that you
On Mon, 18 Jun 2018 09:39:21 -0700, Rick Johnson wrote:
> On Monday, June 18, 2018 at 6:57:27 AM UTC-5, Steven D'Aprano wrote:
>> I still think that Python has been going nowhere but downhill ever
>> since extended slicing was added in version 1.4.
>
> Apples to oranges!
That whooshing noise yo
On Tue, 19 Jun 2018 10:34:55 +0200, ast wrote:
> The animation should last 20s, but on my computer it is twice faster
[...]
> What's wrong ?
Try replacing your CPU with one half as fast.
*wink*
(Sorry for the bad advice, I couldn't resist.)
--
Steven D'Aprano
"Ever since I learned about conf
Hello
I noticed that the speed of animations made
with module matplotlib.animation always seems
wrong.
Here is a small example for demonstration purpose:
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
fig = plt.figure()
ax = fig.add_subplot(111)
tx
Le 2018-06-18 à 22:47, William ML Leslie a écrit :
On 18 June 2018 at 22:18, Etienne Robillard wrote:
Hi,
Quick question: Does anyone of you know what is the effect of enabling
gc.enable() in sitecustomize.py when using PyPy? Can it reduce latency for
long-lived WSGI applications?
gc is en
On 06/18/2018 09:22 PM, Jach Fong wrote:
Ben Finney at 2018/6/19 PM 10:20 wrote:
Jach Fong writes:
Although it passed the first examination, I have no idea if it can
work correctly in the real application:-)
Neither do I. What is the real-world problem you are trying to solve?
Why do you
64 matches
Mail list logo