Re: Static typing [was Re: Python and the need for speed]

2017-06-21 Thread Paul Rubin
Gregory Ewing  writes:
> A JIT compiler works by observing the actual values

To be pedantic, that's called a "tracing JIT".  Other runtime code
generation is also frequently called JIT compilation even when it's
fairly stupid combining of assembly code templates, or the like.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Looping [was Re: Python and the need for speed]

2017-06-21 Thread Paul Rubin
Chris Angelico  writes:
> while True:
> c = sys.stdin.read(1)
> if not c: break
> if c.isprintable(): text += c
> elif c == "\x08": text = text[:-1]
> # etc
> Can you write _that_ as a do-while?

I prefer to write that sort of thing with iterators:

 for c in iter(lambda: sys.stdin.read(1), ''):
 if c.isprintable(): text.append(c)
 elif c == '\x08': text.pop()
 ...
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Very Slow Disk Writes when Writing Large Data Blocks (Posting On Python-List Prohibited)

2017-06-21 Thread remmm
> Have you tried booting up Linux on the same hardware, and running the same 
> tests? That would be a good way to narrow down whether the issue is hardware 
> or software.

No just other Linux systems.  Hardware in question is corporate system -- so 
gray area as to if I can or should boot Linux ... though people do at times.

Good suggestion though.

Rob

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: how to get the html content and edit with scapy and see the edited result in browser?

2017-06-21 Thread Ho Yeung Lee
then i further googled a code, but the google chrome browser and
microsoft edge browser can not see the new html from the fakehttp server

is there something changed to prevent edit html after intercept?
originally i hope to edit https html

Begin emission:
.*
Received 2 packets, got 1 answers, remaining 0 packets
192.168.4.52: http
GET /photo/tv33.bmp HTTP/1.1
Host: 192.168.3.245
Connection: keep-alive
If-None-Match: "100980-9e2bb-5526c85bb2d00"
If-Modified-Since: Tue, 20 Jun 2017 23:22:17 GMT
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 
(KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
Accept: image/webp,image/*,*/*;q=0.8
Referer: http://192.168.3.245/
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8


Begin emission:
.*
Received 2 packets, got 1 answers, remaining 0 packets
.
Sent 1 packets.


second time to run

Begin emission:
..
Received 3254 packets, got 0 answers, remaining 1 packets
192.168.3.245: 54302
≡hx≡ΩIDA   ╧╞s%╒╣δU╫╡δτR₧√╕2¡▀╞~]■N1I┐»÷╜ì Φ@d"Aê╟üXy})═7AV# ƒΩ 
'}&»D=╝àª)■ K╬Γw ┼ü|üâÉ
k,W╢÷å,p!å.9■@â┴!üíçê&CB┘#╜R╛└ü⌡Y╡\gkσ├f 
⌐r-╥Θ╓⌡¬┴OÇÄ=Ų≡°Åò╚ç╥åÅcÑÅ@~Q┼╚┼¬Kå⌐+^*a]¼!RAê*6Θ╔ít  z╤╦ 
Æ2L⌠á1üìÆ£≥î─z╥Y╟┴DΣ%4ÄΘPZ╛!éº÷8╬å╔ö*ÿ
f╢ºΘΣτK╚≥r^ƒ⌐@pr╞FºDúEc÷╠É╛±úíπkg ╟íª=Ç≡0é}áqφàS>╖⌡≥2ZwH_╛£·╥▄╢Tεªσû∞ « 
è%[i╔v¡+ïc╛sÅ1 ç├┌ƒΣ╛Éâ╨yR╤ ╔± s 1hî ╥ $#$ⁿ.8òvdqbu┐Å ét_°τ┼=3┐Åö 
=╢╢)δìHç¡=α╚}⌐║╚Oⁿ]'ÑH√_·> ì⌐>É«1▌/K 
Γ.T%#Ä$αÉSµS÷▐┌║█7∞nπ;ÿ└I=°⌠|X{n{╕/_âßAτ╔"-MD╦▒D^╙rx{çx)N2æ│∩«ΣOΩ▄╜uΩù+pİ`┐┼°{ós┼q░≥Ü▀k9±{£Ωx┬æªn├7╣¿δ
\Gy-∙<÷z»'≥=Å▄ ╩4 ₧╬∙¥ù├Fñc[│»zù{{ ½Gé└  0w_  x╣çO÷▐ëä▓ô/í≈ 
Γ(╚@á#╬¡╘ƒoïk?Å÷√H£'O@|═XΣu₧
Ñj╨óLh\Gt"σsó}α\°|0e Bå
ƒ'αí╖k9½│%xLτì∙6╕<┬q║Q:αô«Fnⁿ╟å╜çÅÇ║5DÜJ£ε@╟▄╢

Re: Very Slow Disk Writes when Writing Large Data Blocks

2017-06-21 Thread remmm
> You'll only reach those numbers in the ideal situation. Is there just one
> program doing this disk i/o, sequentially, from a single thread?

The IO is sequential write of a stream of very large blocks of data onto a 
drive that is only say 30% full.  So yes you should be able to reach 120 mbytes 
per second and you do on some systems.  It's just that other systems including 
my primary system are a factor 7 to 10 slower for the same thing.

> Other than that the only other thing I can think of is interference of
> other programs on the system, such as malware protection or anti-virus 
> tooling that is trying to scan your big files at the same time.  
> That should be visible in Window's resource monitor tool.
IT has tried totally new image -- similar results.  But yes -- normally it's a 
corporate system with all the security bloatware.  Again, we have examples of 
systems with all the bloatware that work... so odd.

> Post it somewhere?
I'll look into putting the test kit on google drive.

Thanks,
Rob

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Instagram: 40% Py3 to 99% Py3 in 10 months (Posting On Python-List Prohibited)

2017-06-21 Thread alister
On Wed, 21 Jun 2017 01:01:06 -0700, Lawrence D’Oliveiro wrote:

> On Wednesday, June 21, 2017 at 6:59:21 PM UTC+12, wxjm...@gmail.com
> wrote:
>> Le mardi 20 juin 2017 15:41:27 UTC+2, bream...@gmail.com a écrit :
>> > On Tuesday, June 20, 2017 at 12:18:50 PM UTC+1, wxjm...@gmail.com
>> > wrote:
>> > > Le mardi 20 juin 2017 11:48:03 UTC+2, Steven D'Aprano a écrit :
>> > > 
>> > > Python (3) on Windows just does not work. Period.
>> > 
>> > Complete drivel from the RUE.  I, and many others, use Python3 on
>> > Windows on a daily basis with not problems at all.  Clearly just a
>> > case of a bad workman always blames his tools.
>> > 
>> > Kindest regards.
>> > 
>> > Mark Lawrence.
>> 
>> A very smooth example. Only the top of the iceberg.
>> 
>> D:\junk>py32 -c "import time; print(time.tzname)"
>> ('Europe de l’Ouest', 'Europe de l’Ouest (heure d’été)')
>> 
>> D:\junk>py33 -c "import time; print(time.tzname)"
>> ('Europe de l\x92Ouest', 'Europe de l\x92Ouest (heure d\x92été)')
> 
> I don’t understand where you get those strings from, or what the “\x92”
> is supposed to be. The best I can do:
> 
> ldo@theon:~> python3.2 -c "print(('Europe de l’Ouest', 'Europe de
> l’Ouest (heure d’été)'))"
> ('Europe de l’Ouest', 'Europe de l’Ouest (heure d’été)')
> ldo@theon:~> python3.3 -c "print(('Europe de l’Ouest', 'Europe de
> l’Ouest (heure d’été)'))"
> ('Europe de l’Ouest', 'Europe de l’Ouest (heure d’été)')
> ldo@theon:~> python3.4 -c "print(('Europe de l’Ouest', 'Europe de
> l’Ouest (heure d’été)'))"
> ('Europe de l’Ouest', 'Europe de l’Ouest (heure d’été)')
> ldo@theon:~> python3.5 -c "print(('Europe de l’Ouest', 'Europe de
> l’Ouest (heure d’été)'))"
> ('Europe de l’Ouest', 'Europe de l’Ouest (heure d’été)')
> ldo@theon:~> python3.6 -c "print(('Europe de l’Ouest', 'Europe de
> l’Ouest (heure d’été)'))"
> ('Europe de l’Ouest', 'Europe de l’Ouest (heure d’été)')
> 
> As you can see, it all works fine. Microsoft Windows trouble?

don't wast time arguing with an idiot
he will simply drag you down to his level then beat you with experience

the only reason I have not killfiled JMX as he serves as a good guide to 
my understanding, if I find myself in agreement with him I assume i must 
be wrong/



-- 
Grand Master Turing once dreamed that he was a machine.  When he awoke
he exclaimed:
"I don't know whether I am Turing dreaming that I am a machine,
or a machine dreaming that I am Turing!"
-- Geoffrey James, "The Tao of Programming"
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Instagram: 40% Py3 to 99% Py3 in 10 months (Posting On Python-List Prohibited)

2017-06-21 Thread Michael Torrie
On 06/21/2017 12:25 AM, Chris Angelico wrote:
> By "ships with", do you mean that it's not there by default, or that
> you can't get it through yum? Because if it's just the former, you
> should be able to declare that your program depends on Python 3. RHEL
> 6 came out in 2010 and RHEL 7 in 2014, so I would be very surprised if
> there's no Python 3 available in either (the latter should have been
> able to pick up 3.3 or 3.4, depending on feature freeze).

Python3 is not in the official repos at all for either RHEL 6 or 7.
Certainly not 4 or 5.

It is, however, available in EPEL repository. EPEL is associated loosely
with Red Hat, but it's by no means and officially-supported repository,
and many organizations may have policies disallowing its use, or the use
of any other third-party repo, for security and stability reasons.

Docker might be another possibility for using and deploying Python3 apps
in RHEL, although Docker itself is a third-party installation, although
from a corporate point of view, since Docker is available with
commercial support, it may be allowed.

Also Red Hat has a repo called the "Software Collections Library" that
contains up-to-date compilers and languages, including Python 3.6.
However by design these packages install into specialized,
self-contained environments (not in the system path or library search
path) so as not to conflict in any way with system versions.  As such
they are a bit awkward to deal with, particularly if you want to build
applications using Python 3.6 from the SCL and run them normally in
RHEL.  You'd need a wrapper script to set up the runtime environment
before running the Python script.


-- 
https://mail.python.org/mailman/listinfo/python-list


EuroPython 2017: Conference app available in app stores

2017-06-21 Thread M.-A. Lemburg
We are pleased to announce our very own mobile app for the EuroPython
2017 conference:


  * https://ep2017.europython.eu/en/events/conference-app/ *

EuroPython 2017 Conference App



Engage with the conference and its attendees


The mobile app gives you access to the conference schedule (even
offline), helps you in planing your conference experience (create your
personal schedule) and provides a rich social engagement platform for
all attendees.

You can create a profile within the app (or link this to your existing
social accounts), share messages and photos, and easily reach out to
other fellow attendees - all from within the app.

The app is available for Android, iOS and as web app for other mobile
devices:

https://ep2017.europython.eu/en/events/conference-app/#Install-the-EuroPython-2017-mobile-app


Vital for all EuroPython attendees
--

We will again use the conference app to keep you updated by sending
updates of the schedule and inform you of important announcements via
push notifications, so please consider downloading it.

Many useful features


Please see our EuroPython 2017 Conference App page for more details on
features and guides on how to use them:

https://ep2017.europython.eu/en/events/conference-app/



Don’t forget to get your EuroPython ticket
--

If you want to join the EuroPython fun, be sure to get your tickets as
soon as possible, since ticket sales have picked up quite a bit after
we announced the schedule.

https://ep2017.europython.eu/en/registration/


Enjoy,
--
EuroPython 2017 Team
http://ep2017.europython.eu/
http://www.europython-society.org/

PS: Please forward or retweet to help us reach all interested parties:
https://twitter.com/europython/status/877495457479524353
Thanks.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Progress on the Gilectomy

2017-06-21 Thread Paul Rubin
Lawrence D’Oliveiro  writes:
> The trouble with GC is, it doesn’t know when to kick in: it just keeps
> on allocating memory until it runs out.

That's not how GC works, geez.  Typically it would run after every N
bytes of memory allocated, for N chosen to balance memory footprint
with cpu overhead.  
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Progress on the Gilectomy

2017-06-21 Thread Steve D'Aprano
On Thu, 22 Jun 2017 08:23 am, breamore...@gmail.com wrote:

> Don't you know that Lawrence D’Oliveiro has been banned from the mailing list
> as he hasn't got a clue what he's talking about, 

That's not why he was given a ban. Being ignorant is not a crime -- if it were,
a lot more of us would be banned, including all newbies.


> just like the RUE? 

What is your obsession with wxjmfauth? You repeatedly mention him in unrelated
discussions.


-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Progress on the Gilectomy (Posting On Python-List Prohibited)

2017-06-21 Thread Steve D'Aprano
On Thu, 22 Jun 2017 10:30 am, Lawrence D’Oliveiro wrote:

> Once again: The trouble with GC is, it doesn’t know when to kick in: it just
> keeps on allocating memory until it runs out.

Once again: no it doesn't.


Are you aware that CPython has a GC? (Or rather, a *second* GC, apart from the
reference counter.) It runs periodically to reclaim dead objects in cycles that
the reference counter won't free. It runs whenever the number of allocations
minus the number of deallocations exceed certain thresholds, and you can set
and query the thresholds using:

gc.set_threshold

gc.get_threshold


CPython alone disproves your assertion that GCs "keep on allocating memory until
it runs out". Are you aware that there are more than one garbage collection
algorithm? Apart from reference-counting GC, there are also "mark and sweep"
GCs, generational GCs (like CPython's), real-time algorithms, and more.

One real-time algorithm implicitly divides memory into two halves. When one half
is half-full, it moves all the live objects into the other half, freeing up the
first half.

The Mercury programming language even has a *compile time* garbage collector
that can determine when an object can be freed during compilation -- no sweeps
or reference counting required.

It may be that *some* (possibly toy) GC algorithms behave as you say, only
running when memory is completely full. But your belief that *all* GC
algorithms behave this way is simply wrong.



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Progress on the Gilectomy (Posting On Python-List Prohibited)

2017-06-21 Thread Paul Rubin
Lawrence D’Oliveiro  writes:
> while “memory footprint” depends on how much memory is actually being
> retained in accessible objects.

If the object won't be re-accessed but is still retained by gc, then
refcounting won't free it either.

> Once again: The trouble with GC is, it doesn’t know when to kick in:
> it just keeps on allocating memory until it runs out.

When was the last time you encountered a problem like that in practice?
It's almost never an issue.  "Runs out" means reached an allocation
threshold that's usually much smaller than the program's memory region.
And as you say, you can always manually trigger a gc if the need arises.
-- 
https://mail.python.org/mailman/listinfo/python-list