Re: Copy-on-write friendly Python garbage collection

2018-01-01 Thread INADA Naoki
FYI: https://bugs.python.org/issue31558
INADA Naoki  


On Mon, Jan 1, 2018 at 12:39 AM,   wrote:
> An interesting write up on something that is incorporated into Python 3.7 
> https://engineering.instagram.com/copy-on-write-friendly-python-garbage-collection-ad6ed5233ddf
>
> --
> Kindest regards.
>
> Mark Lawrence.
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread bartc

On 01/01/2018 00:40, MRAB wrote:

On 2017-12-31 23:21, bartc wrote:


[Block delimiting]


proc fn2(int a)=

...

end

(or possibly "inline f123=").

[snip]

OT: if "case ... esac" and "if ... fi", why not "proc ... corp"? :-)


(I don't think Algol-68 used corp otherwise it might have been copied 
too. But I also have 'function', and 'noitcnuf' would be a bit much.


Anyway in this variation of the syntax, there is a choice of block endings.

So 'case' can be closed with 'end', 'endcase', 'end case' or 'esac'.

With loops like while-do, either 'while' or 'do' can be the keyword.

For some kinds of blocks, (...) can be used.

But there can't be no block ending as in Python; there has to be 
something. Indentation here is not significant.)


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


Re: Copy-on-write friendly Python garbage collection

2018-01-01 Thread breamoreboy
On Sunday, December 31, 2017 at 6:19:13 PM UTC, Wu Xi wrote:
> breamoreboy:
> > An interesting write up on something that is incorporated into Python 3.7 
> > https://engineering.instagram.com/copy-on-write-friendly-python-garbage-collection-ad6ed5233ddf
> 
> Appearantly, Erlang is the way to go, when it comes to web frameworks.

What has that got to do with the subject of this thread?

--
Kindest regards.

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


Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread breamoreboy
On Sunday, December 31, 2017 at 6:56:16 PM UTC, bartc wrote:
> On 31/12/2017 17:01, breamoreboy wrote:
> 
> >Further I've never once in 17 years of using Python been tearing my hair out 
> >over the lack of goto
> 
> Neither have I over all the advanced features of Python I never use, and 
> for double that number of years.

I suggest that you steer well clear of all of Python's advanced features until 
you understand the Python philosophy as laid down in the Zen of Python.  
However I cannot see that happening as you seem to dispute everything about 
Python, flying in the face of any advice that you get from all the very 
experienced Pythonistas who frequent this place.  You must have access to the 
PSU's time machine if you've 34 years experience of Python as it hasn't been 
out that long.

> 
> Yet for some they will be as indispensable as they are incomprehensible 
> to others.

Let's all go back to machine code.

--
Kindest regards.

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


Re: Copy-on-write friendly Python garbage collection

2018-01-01 Thread Wu Xi
[email protected]:
> On Sunday, December 31, 2017 at 6:19:13 PM UTC, Wu Xi wrote:
>> breamoreboy:
>>> An interesting write up on something that is incorporated into Python 3.7 
>>> https://engineering.instagram.com/copy-on-write-friendly-python-garbage-collection-ad6ed5233ddf
>>
>> Appearantly, Erlang is the way to go, when it comes to web frameworks.
> 
> What has that got to do with the subject of this thread?

Well, a little implicitly. Pointing out Erlang superiority in a pythonic 
newsgroup is, of course, heresy.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: tkinter MP working like a charm - almost...

2018-01-01 Thread Wu Xi
from tkinter import * ; from tkinter import messagebox
import asyncio ,  random

async def one_url(url):  
""" This is a multi threaded tkinter demo where tasks run in the background 
and aim to not freeze the tk GUI, py v3.7"""
sec = random.randint(1, 8)
await asyncio.sleep(sec  )
return 'url: {}  took {}  seconds'.format(url, sec)

async def do_urls():   
""" Creating and starting 10 tasks. """
tasks   = [one_url(url)  for url  inrange(10)]
completed, pending = await asyncio.wait(tasks)
results = [task.result() for task incompleted]
print('\n'.join(results))

def do_nofreeze(): messagebox.showinfo(message='see, Tkinter is still 
responsive.')

def widgets(master):   Button(master, text='GUI Frozen?',   
command=do_nofreeze).pack()

def tk_update(interval): 
""" A production version of this should make it possible to cancel. 
However, when loop stops, updates will stop. T. Reedy"""
loop.call_later(  interval,  root.update  )
root.update()

if __name__ == '__main__':
root = Tk()
widgets(root)
loop = asyncio.get_event_loop()
tk_update(.05)
loop.run_until_complete(do_urls())  
#   wow! no call to  root.mainloop()  
anymore. somehow like in IDLE - but it freezes now :-( 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: you shortened it, but you broke it too... ;-)

2018-01-01 Thread Ned Batchelder

On 12/31/17 8:15 PM, Wu Xi wrote:

def neighbours(point):
  x,y = point
   
  yield x + 1 , y

  yield x - 1 , y
  yield x , y + 1
  yield x , y - 1 #this is proof that life can emerge 
inside of computers and cellular automatons,
   
  yield x + 1 , y + 1 #and evolve through memory, attack other cells and morph into toads, pulsars, etc..

  yield x + 1 , y - 1
  yield x - 1 , y + 1 #spray your memory with space alien 
patterns and life evolution will start in your machine !
  yield x - 1 , y - 1


This code correctly yields eight new coordinates
  
  '''

  for i in range(-1, 2) :
 for j in range(-1, 2) :
 if i != j :
 yield x + i, y + j

  '''


This code only yields six of the eight needed.

  # yield from [(x+i, x+j) for i in [-1,1] for j in [-1,1]]
  


This code only yields four!

Perhaps this is what you are looking for:

    def neighbors(point):
    x, y = point
    for dx in [-1, 0, 1]:
    for dy in [-1, 0, 1]:
    if dx == dy == 0:
    continue
    yield x + dx, y + dy


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


Re: Anaconda Navigator : Add App

2018-01-01 Thread Ian
Anaconda is v3.6


very 2017'ish by now... 


;-)

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


Re: Mr. Conway in 50 lines of code (Posting On Python-List Prohibited)

2018-01-01 Thread Wu Xi


the short versions are not equivalent, proggy won't work with them


> def neighbours(point):
>  x,y = point
>   
>  yield x + 1 , y
>  yield x - 1 , y
>  yield x , y + 1
>  yield x , y - 1 #this is proof that life can emerge 
> inside of computers and cellular automatons,
>   
>  yield x + 1 , y + 1 #and evolve through memory, attack 
> other cells and morph into toads, pulsars, etc..
>  yield x + 1 , y - 1
>  yield x - 1 , y + 1 #spray your memory with space alien 
> patterns and life evolution will start in your machine !
>  yield x - 1 , y - 1
>  
>  '''
>  for i in range(-1, 2) :
> for j in range(-1, 2) :
> if i != j :
> yield x + i, y + j
> 
>  '''
>  # yield from [(x+i, x+j) for i in [-1,1] for j in [-1,1]]
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: tkinter MP working like a charm

2018-01-01 Thread Wu Xi
Abdur-Rahmaan Janhangeer:
> it seems that the original poster's mail went missing
> 
> leugenpresse means lying press btw
> 
> weird
> 
> i doubt the author wanted to prank us by announcing i did this and that.
> 
> Abdur-Rahmaan Janhangeer,
> Mauritius
> abdurrahmaanjanhangeer.wordpress.com
> 
> On 31 Dec 2017 5:00 am, "Wu Xi"  wrote:
> 
>> from tkinter import *#I cant see



Lügen Presse = lying press , fake news makers - indeed.

Using a real news reader, changing the post's topic still keeps the posting 
chain intact. I hope ypu don't use soft not giving you that post concatenation 
feature.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread Peter J. Holzer
On 2017-12-30 11:07:56 -0500, Dennis Lee Bieber wrote:
> On Sat, 30 Dec 2017 13:46:14 +0100, "Peter J. Holzer" 
> declaimed the following:
> 
> >I don't think this is correct. Structured programming is much older:
> >ALGOL 60 was already a block structured language and Dijkstra wrote
> >"goto considered harmful" in the late 1960s. Pascal appeared in 1970, C
> >in 1974. To me (who learned to program in BASIC on a CP/M machine), C
> >is very much a structured programming language. If structured
> >programming gained traction around 1980, it might even have been because
> >structured languages like C with good performance became widely
> >available.
> >
>   There is a slight difference between just being block structured and
> full structured programming (at the time "one-entry/one-exit per
> construct".

I'd say there is a rather big difference: One is a programming paradigm,
the other a syntactic aid for the former. You can do structured
programming in assembler (I did in BASIC), but it is a lot easier and
natural in a block-structured language. I wasn't present when ALGOL was
invented (I wasn't even born then), but I am sure that the inventors
shared much of the mindset of "structured programming" (although the
name may not yet have been invented).

> Even Pascal still had a GOTO statement,

Yes. I don't know any language which enforces "pure" structured
programming. They all have some constructs (goto, break, return,
exceptions, ...) to leave a block early. I don't think that invalidates
my point that the concept of structured programming predates Pascal.

> and flow-charts were still part of documentation at school.

We learned about them in the 80's, too (along with Nassi-Shneiderman
diagrams). And in fact I still use them sometimes (although more
frequently to document processes for humans than for computers).
(I don't use NS diagrams at all anymore: They have no advantages over
pseudo code for me.)

>   The /teaching/ of structured programming as a discipline didn't really
> show up until my final year in college (79-80) and the first few years at
> Lockheed

I can't comment on how wide-spread teaching of structured programming
was, since I am too young. But since Pascal was explicitely intended as
a teaching language for structured programming, there must have been at
least a few professors to teach it in the late 1960's.

> -- which was also a time period when such abominations as TEXTFOR,
> MORTRAN, and RATFOR were created to allow for doing structured programming
> in FORTRAN-IV

And regardless of the quality (or lack thereof) of these preprocessors
I'd argue that they were created (and used) because at the time many
programmers thought that structured programming was a good idea. 

Is there any mainstream (procedural) computer language invented after
1970 which doesn't try to encourage structured programming?

hp

-- 
   _  | Peter J. Holzer| we build much bigger, better disasters now
|_|_) || because we have much more sophisticated
| |   | [email protected] | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson 


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread bartc

On 01/01/2018 14:54, Peter J. Holzer wrote:

On 2017-12-30 11:07:56 -0500, Dennis Lee Bieber wrote:



Yes. I don't know any language which enforces "pure" structured
programming. They all have some constructs (goto, break, return,
exceptions, ...) to leave a block early. I don't think that invalidates
my point that the concept of structured programming predates Pascal.


Functional languages?

Some banish not only goto, but the concepts of assignments, and variables.

And even functions have to be pure with no side-effects, which makes I/O 
a problem.


They are really intent on making life difficult.

--
bartc

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


... (Posting On Python-List Prohibited)

2018-01-01 Thread Wu Xi

>>     (Posting On Python-List Prohibited)



>>  why ?


 
> I'm posting to the usenet group comp.lang.python (an off-topic reply to an 
> off-topic remark, but it happens).

> I've no idea what the prohibited part is about, if that's what you're posting 
> about. But there have been dozens of other messages with the same subject.



that's right. on 

https://mail.python.org/pipermail/python-list/2018-January/subject.html#start


which feeds intocomp.lang.python,

a lot of messages are missing. Appearantly there is some oppression scheme 
going on.



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


Re: Copy-on-write friendly Python garbage collection (Posting On Python-List Prohibited)

2018-01-01 Thread Niles Rogoff
On Mon, 01 Jan 2018 10:42:58 -0800, breamoreboy wrote:

> On Monday, January 1, 2018 at 10:14:59 AM UTC, [email protected] wrote:
>> Le lundi 1 janvier 2018 08:35:53 UTC+1, Lawrence D’Oliveiro a écrit :
>> > On Monday, January 1, 2018 at 7:52:48 AM UTC+13, Paul Rubin wrote:
>> > > I wonder if things would suffer if they tried a more aggressive
>> > > approach and ditched refcounting completely.
>> > 
>> > One thing that would suffer is Python’s well-behaved memory usage.
>> > You would need to start imposing heap usage limits, like you do in
>> > Java.
>> 
>> Memory:
>> 
>> >>> sys.getsizeof('abcdefghij' + '$')
>> 36
>> >>> sys.getsizeof('abcdefghij' + '€')
>> 60
>> >>> sys.getsizeof(('abcdefghij' + '€').encode('utf-8'))
>> 30
>> >>> sys.getsizeof('abcdefghij' + '\U0001')
>> 84
>> >>> sys.getsizeof(('abcdefghij' + '\U0001').encode('utf-8'))
>> 31
>> >>>
>> >>>
>> Performance:
>> "anti - utf-32"
>> 
>> Buggyness:
>> Better to not comment.
>> 
>> Python is the single language, which is presenting the opposite of what
>> Unicode.org offers on the side of memory *and* on the side of
>> performance, utf-8 *and* utf-32 !
>> 
>> Happy new year.
> 

He's right though. I would encourage anyone interested to check out 
http://utf8everywhere.org/
> Your usual drivel.  When are you going to stop banging this drum, you've
> done nothing else for the past five years?

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


Re: stop prohibition of comp.lang.python !

2018-01-01 Thread breamoreboy
On Monday, January 1, 2018 at 3:00:19 PM UTC, S. I. wrote:
> stop prohibition of comp.lang.python !
> 
> it is childish to do this prohibition business !
> 
> don't you have spam filters ?

The prohibition part of the subject line is added by Lawrence D'Oliveiro when 
he posts on google groups as he's been banned from the mailing list.  Most 
people won't see it until someone replies to his post via their email to the 
list.

--
Kindest regards.

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


Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread bartc

On 01/01/2018 15:06, From wrote:
   



 


(Posting On Python-List Prohibited)



 why ?



Huh?

I'm posting to the usenet group comp.lang.python (an off-topic reply to 
an off-topic remark, but it happens).


I've no idea what the prohibited part is about, if that's what you're 
posting about. But there have been dozens of other messages with the 
same subject.

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


Re: ... (Posting On Python-List Prohibited)

2018-01-01 Thread breamoreboy
On Monday, January 1, 2018 at 9:28:01 PM UTC, Wu Xi wrote:
> > Blocking of spamming and trolling prevents oppression of people who want to 
> > use the list, funded by PSF, for its purpose, discussion of Python.
> 
> why are PSF funds privileged over anybody else's fund, which has zero 
> privilege?

Congratulations, after just a couple of days you're all ready pushing for a 
place in my dream team.

--
Kindest regards.

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


Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread John Q Hacker
Sorry, delete string "n't".  I mean that you would strcuture your code
with that architecture.

Hate that.

marxos

On 1/1/18, John Q Hacker  wrote:
>>> I don’t use gotos in C code. Why should it be “harder” in a higher-level
>>> language?
>>
>> Good for you.
>>
>> Looking at 14 million lines of Linux kernel sources, which are in C,
>> over 100,000 of them use 'goto'. About one every 120 lines.
>
> Most use of goto's implies a lack of understanding of the unseen
> architecture of the problem domain itself (otherwise, you wouldn't
> have structured your program with that architecture).  The only
> remaining use is optimization, and most of that is probably premature,
> as use of gotos *can* make things hard to understand, but using labels
> is a pretty happy medium.
>
> Marxos
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ✨🍰✨ python 2018 wiki - a piece of cake ✨🍰✨

2018-01-01 Thread Chris Angelico
On Tue, Jan 2, 2018 at 9:44 AM,   wrote:
> On Monday, January 1, 2018 at 2:54:26 PM UTC, S. I. wrote:
>> https://practical-scheme.net/wiliki/wiliki.cgi?python
>>
>> no register, no nothing !   just edit.
>>
>> ✨🍰✨  python - a piece of cake  ✨🍰✨
>>
>> just edit or enter acode.py   entry with
>>
>> {{{
>>
>> print(" oh yes, 2018   ")
>>
>> }}}
>
> From the link "Look at those scumbag admins over at the py wiki.", "what 
> utter pieces of s., man: 
> https://mail.python.org/pipermail/pydotorg-www/2017-June/004316.html";, "the 
> scum admins are waging another wiki war, follow it here: 
> https://mail.python.org/pipermail/pydotorg-www/";, "more Lemburg-type bs:" and 
> "Nothing but scum in the py wiki".  Were you the author of "How To Win 
> Friends And Influence People"?
>

Just FYI, the posts you're quoting here aren't making it to my inbox.
I believe they're getting blocked at the news/mail gateway (though it
could be elsewhere, for all I know). If you ignore them, we here in
the tame land of the mailing list would be cheerfully unaware of the
horrors ravaging the Wild West of the newsgroup.

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


Re: Copy-on-write friendly Python garbage collection (Posting On Python-List Prohibited)

2018-01-01 Thread Niles Rogoff

> Niles, if you want to claim wxjmfauth is right, you'll have to present
> some actual evidence.  He's claimed for years that Python's Unicode
> support is buggy (as he does here), without ever demonstrating a bug.
> We've long ago tired of trying to reason with him.
> 
> The tradeoffs of memory use for algorithmic complexity are well
> understood, and have been endlessly discussed. There is not an
> "obviously right" answer to how to make those tradeoffs.
> 
> --Ned.

Aah, I didn't know, I'm new here. I thought he was referring to UTF-16 
being inefficient, which is mostly what I was agreeing with.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread John Q Hacker
>> I don’t use gotos in C code. Why should it be “harder” in a higher-level
>> language?
>
> Good for you.
>
> Looking at 14 million lines of Linux kernel sources, which are in C,
> over 100,000 of them use 'goto'. About one every 120 lines.

Most use of goto's implies a lack of understanding of the unseen
architecture of the problem domain itself (otherwise, you wouldn't
have structured your program with that architecture).  The only
remaining use is optimization, and most of that is probably premature,
as use of gotos *can* make things hard to understand, but using labels
is a pretty happy medium.

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


Re: How to create a python extension module from a shared library?

2018-01-01 Thread Etienne Robillard
So far I found the SWIG method quite good. But I really think that I 
will try patching CFFI to use libclang natively.


Etienne


Le 2017-12-29 à 20:00, Etienne Robillard a écrit :

Hi all,

I would like to extend uWSGI by creating a CPython extension module 
for the libuwsgi.so shared library included in the distribution.


My goal is to use this automatically generated CPython module for 
extending uWSGI.


I have summarized my current approach here:

https://mail.python.org/pipermail/tutor/2017-December/112475.html

So far, I have tried to use CFFI and pycparser to generate the Python 
bindings, however CFFI and pycparser doesn't handle C directives like 
#include and #define.


I also attempted using clang to preprocess the "uwsgi.h" header found 
in the uWSGI distro with pycparser.parse_file() to generate a AST, 
however the generated AST object seems incorrect.


Is there any way to reflect a shared library into a CPython module?

I know that using "nm -D libuwsgi.so" I can get a list of available 
functions for this module. However, I have very little experience with 
ctypes and CFFI.


Do I need to modify CFFI to allow it to parse a C header with libclang?

I'm guessing CFFI/clang or ctypes should allow me to reflect the 
shared library, but I'm not sure about which method is the most 
appropriate.



What do you think?

Sincerely,

Etienne



--
Etienne Robillard
[email protected]
https://www.isotopesoftware.ca/

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


Re: ✨🍰✨ python 2018 wiki - a piece of cake ✨🍰✨

2018-01-01 Thread breamoreboy
On Monday, January 1, 2018 at 2:54:26 PM UTC, S. I. wrote:
> https://practical-scheme.net/wiliki/wiliki.cgi?python
> 
> no register, no nothing !   just edit.
> 
> ✨🍰✨  python - a piece of cake  ✨🍰✨
> 
> just edit or enter acode.py   entry with 
>  
> {{{
> 
> print(" oh yes, 2018   ")
> 
> }}}

From the link "Look at those scumbag admins over at the py wiki.", "what utter 
pieces of s., man: 
https://mail.python.org/pipermail/pydotorg-www/2017-June/004316.html";, "the 
scum admins are waging another wiki war, follow it here: 
https://mail.python.org/pipermail/pydotorg-www/";, "more Lemburg-type bs:" and 
"Nothing but scum in the py wiki".  Were you the author of "How To Win Friends 
And Influence People"?

--
Kindest regards.

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


Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread Chris Green
Dennis Lee Bieber  wrote:
> 
> Well... "break" does bypass the rest of the block, but it still exits
> via the end of the block. I have a tendency to try for one "return" per
> procedure (so I'm more likely to have an "if ...: break" then "if ...:
> return"). 

I have always tried to enforce 'only one return per function'.  If
there are multiple returns it makes maintenance very difficult as
'clear up' code can get bypassed.

-- 
Chris Green
·
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ... (Posting On Python-List Prohibited)

2018-01-01 Thread Wu Xi

> Blocking of spamming and trolling prevents oppression of people who want to 
> use the list, funded by PSF, for its purpose, discussion of Python.

why are PSF funds privileged over anybody else's fund, which has zero privilege?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Copy-on-write friendly Python garbage collection

2018-01-01 Thread breamoreboy
On Monday, January 1, 2018 at 12:53:03 PM UTC, Wu Xi wrote:
> breamoreboy:
> > On Sunday, December 31, 2017 at 6:19:13 PM UTC, Wu Xi wrote:
> >> breamoreboy:
> >>> An interesting write up on something that is incorporated into Python 3.7 
> >>> https://engineering.instagram.com/copy-on-write-friendly-python-garbage-collection-ad6ed5233ddf
> >>
> >> Appearantly, Erlang is the way to go, when it comes to web frameworks.
> > 
> > What has that got to do with the subject of this thread?
> 
> Well, a little implicitly. Pointing out Erlang superiority in a pythonic 
> newsgroup is, of course, heresy.

Python is fourth in the latest TIOBE index, Erlang doesn't even make the top 
20, so in what way is it superior?

Python doesn't need Pinky and the Brain in its quest to take over the world.

--
Kindest regards.

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


Re: Scientific Python moving to Python 3 only.

2018-01-01 Thread MRAB

On 2018-01-01 06:10, Terry Reedy wrote:

https://github.com/numpy/numpy/blob/master/doc/neps/dropping-python2.7-proposal.rst

Numpy people currently plan to stop adding features to their 2.7 branch
after Dec 31, 2018 and stop adding bug fixes to the last version
supporting 2.7 a year later, Dec 31, 2019.  It will remain available for
pip installation, and possible support by other (most likely commercial)
parties.

http://www.python3statement.org/
About 30 other projects, including other part of the python-science
stack, have 'pledged' to so something similar.

FTR, I'll be dropping support for the regex module on Python 2 at about 
the same time.


(In practice, there's a lot of code sharing with regex on Python 3, but 
if it's not a bug on Python 3, then it'll be "Won't fix".)

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


Re: Copy-on-write friendly Python garbage collection (Posting On Python-List Prohibited)

2018-01-01 Thread Ned Batchelder

On 1/1/18 1:49 PM, Niles Rogoff wrote:

On Mon, 01 Jan 2018 10:42:58 -0800, breamoreboy wrote:


On Monday, January 1, 2018 at 10:14:59 AM UTC, [email protected] wrote:

Le lundi 1 janvier 2018 08:35:53 UTC+1, Lawrence D’Oliveiro a écrit :

On Monday, January 1, 2018 at 7:52:48 AM UTC+13, Paul Rubin wrote:

I wonder if things would suffer if they tried a more aggressive
approach and ditched refcounting completely.

One thing that would suffer is Python’s well-behaved memory usage.
You would need to start imposing heap usage limits, like you do in
Java.

Memory:


sys.getsizeof('abcdefghij' + '$')

36

sys.getsizeof('abcdefghij' + '€')

60

sys.getsizeof(('abcdefghij' + '€').encode('utf-8'))

30

sys.getsizeof('abcdefghij' + '\U0001')

84

sys.getsizeof(('abcdefghij' + '\U0001').encode('utf-8'))

31



Performance:
"anti - utf-32"

Buggyness:
Better to not comment.

Python is the single language, which is presenting the opposite of what
Unicode.org offers on the side of memory *and* on the side of
performance, utf-8 *and* utf-32 !

Happy new year.

He's right though. I would encourage anyone interested to check out
http://utf8everywhere.org/

Niles, if you want to claim wxjmfauth is right, you'll have to present 
some actual evidence.  He's claimed for years that Python's Unicode 
support is buggy (as he does here), without ever demonstrating a bug.  
We've long ago tired of trying to reason with him.


The tradeoffs of memory use for algorithmic complexity are well 
understood, and have been endlessly discussed. There is not an 
"obviously right" answer to how to make those tradeoffs.


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


Humble Book Bundle: Python by Packt

2018-01-01 Thread beliavsky--- via Python-list
One can purchase the following Python books and videos published by Packt for 
$15 at https://www.humblebundle.com/books/python-by-packt-book-bundle for about 
the next two weeks.

Python Data Analysis Cookbook
Mastering Python, Second Edition
Learning Robotics using Python
Python Programming with Raspberry Pi
Web Development with Django Cookbook
Expert Python Programming, Second Edition
Learning Python Web Penetration Testing (Video)
Python Data Science Essentials, Second Edition
Learning Concurrency in Python
Python Data Structures and Algorithms
Beginning Python (Video)
Building RESTful Python Web Services
Mastering Python Networking
Artificial Intelligence with Python
Deep Learning with Python (Video)
Python Machine Learning Projects (Video)
Python Machine Learning
Python Microservices Development
Python Design Patterns (Video)
Software Architecture with Python
Modern Python Cookbook
Python High Performance, Second Edition
Python GUI Programming Cookbook, Second Edition
Mastering Python (Video)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: stop prohibition of comp.lang.python ! D'Oliveiro should wear this as a badge of honour.

2018-01-01 Thread breamoreboy
On Monday, January 1, 2018 at 11:06:30 PM UTC, P. timoriensis wrote:
> >> stop prohibition of comp.lang.python !
> >>
> >> it is childish to do this prohibition business !
> >>
> >> don't you have spam filters ?
> > 
> > The prohibition part of the subject line is added by Lawrence D'Oliveiro 
> > when he posts on google groups as he's been banned from the mailing list.  
> > Most people won't see it until someone replies to his post via their email 
> > to the list.
> 
> > Mark Lawrence.
>  
> these cases are always the same: the censors in 99% of the cases are utterly 
> wrong.
> 
> 
> D'Oliveiro must be a good man, proof is here. 
> I know what to think about python-list censorship already.

Like the case of the guy who was banned as he was using the list to spread 
antisemitic drivel through his signatures?

If you don't like this facility you are perfectly welcome to leave and never 
come back.

--
Kindest regards.

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


Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread Chris Angelico
On Tue, Jan 2, 2018 at 7:16 AM, Chris Green  wrote:
> Dennis Lee Bieber  wrote:
>>
>> Well... "break" does bypass the rest of the block, but it still exits
>> via the end of the block. I have a tendency to try for one "return" per
>> procedure (so I'm more likely to have an "if ...: break" then "if ...:
>> return").
>
> I have always tried to enforce 'only one return per function'.  If
> there are multiple returns it makes maintenance very difficult as
> 'clear up' code can get bypassed.
>

Isn't that why try/finally exists? No matter how many 'return'
statements you have, there's always exceptions to bypass any naive
cleanup code; and no matter how many returns you have, 'finally'
blocks still execute before return.

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


Re: ... (Posting On Python-List Prohibited)

2018-01-01 Thread Chris Angelico
On Tue, Jan 2, 2018 at 8:27 AM, Wu Xi  wrote:
>
>> Blocking of spamming and trolling prevents oppression of people who want to 
>> use the list, funded by PSF, for its purpose, discussion of Python.
>
> why are PSF funds privileged over anybody else's fund, which has zero 
> privilege?

If you want to host your own mailing list on your own server, you're
welcome to. All the software you need is open source. (In fact, I can
and do host several mailing lists, though not for the discussion of
Python.)

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


web fw performance with Erlang

2018-01-01 Thread Wu Xi

>> Well, a little implicitly. Pointing out Erlang superiority in a pythonic 
>> newsgroup is, of course, heresy.
> 
> Python is fourth in the latest TIOBE index, Erlang doesn't even make the top 
> 20, so in what way is it superior?
> 
> Python doesn't need Pinky and the Brain in its quest to take over the world.



Erlang is so fast, they had to ban erlang from competing here: 
https://www.techempower.com/benchmarks/#section=data-r14&hw=ph&test=fortune

worst loser is the python framework of course
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread Chris Angelico
On Tue, Jan 2, 2018 at 9:11 AM,   wrote:
> On Monday, January 1, 2018 at 9:35:06 PM UTC, Chris Angelico wrote:
>> On Tue, Jan 2, 2018 at 7:16 AM, Chris Green wrote:
>> > Dennis Lee Bieber wrote:
>> >>
>> >> Well... "break" does bypass the rest of the block, but it still 
>> >> exits
>> >> via the end of the block. I have a tendency to try for one "return" per
>> >> procedure (so I'm more likely to have an "if ...: break" then "if ...:
>> >> return").
>> >
>> > I have always tried to enforce 'only one return per function'.  If
>> > there are multiple returns it makes maintenance very difficult as
>> > 'clear up' code can get bypassed.
>> >
>>
>> Isn't that why try/finally exists? No matter how many 'return'
>> statements you have, there's always exceptions to bypass any naive
>> cleanup code; and no matter how many returns you have, 'finally'
>> blocks still execute before return.
>>
>> ChrisA
>
> What happened to context managers?
>

They're a way of wrapping up repeatedly-used try/finally blocks. The
try/finally construct is the underlying functionality. In any case,
the same behaviour can be used by either, so yes, if you have cleanup
code and you're using 'with x:' rather than try/finally, it still fits
into the same concept that I'm describing, and still guarantees that
the cleanup code is executed before return.

(Yes, I know it's possible to bypass finally blocks. But the methods
for doing so (eg hard-aborting) also bypass the actual return, so the
"before return" part is still valid. If you're doing things that
depend on cleanup outside the process, like deleting temporary files,
you'll need something more than try/finally. But in that case, there's
no other code layout that would help you anyway.)

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


Re: ... (Posting On Python-List Prohibited)

2018-01-01 Thread Peter J. Holzer
On 2018-01-01 21:27:00 +, Wu Xi wrote:
> > Blocking of spamming and trolling prevents oppression of people who
> > want to use the list, funded by PSF, for its purpose, discussion of
> > Python.
> 
> why are PSF funds privileged over anybody else's fund, which has zero
> privilege?

Because they pay for the server which runs the list. Their server, their
rules. If you set up a server which hosts a mailing list, a web forum,
or whatever, you get to decide ther rules for your server.

hp

-- 
   _  | Peter J. Holzer| we build much bigger, better disasters now
|_|_) || because we have much more sophisticated
| |   | [email protected] | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson 


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ... (Posting On Python-List Prohibited)

2018-01-01 Thread Terry Reedy

On 1/1/2018 1:28 PM, Wu Xi wrote:

on
https://mail.python.org/pipermail/python-list/2018-January/subject.html#start
which feeds intocomp.lang.python,
a lot of messages are missing. Appearantly there is some oppression scheme 
going on.


Blocking of spamming and trolling prevents oppression of people who want 
to use the list, funded by PSF, for its purpose, discussion of Python.


--
Terry Jan Reedy

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


Re: ... (Posting On Python-List Prohibited)

2018-01-01 Thread breamoreboy
On Monday, January 1, 2018 at 10:21:15 PM UTC, P. timoriensis wrote:
> >>> Blocking of spamming and trolling prevents oppression of people who want 
> >>> to use the list, funded by PSF, for its purpose, discussion of Python.
> >>
> >> why are PSF funds privileged over anybody else's fund, which has zero 
> >> privilege?
> > 
> > Congratulations, after just a couple of days you're all ready pushing for a 
> > place in my dream team.
> 
> you sure would make for just another one of those self-appointed censors, who 
> won't react to legit questions, when they realize how dangerous they are.

I don't see a legitimate question, I see a completely stupid question.  The PSF 
pays the money, the PSF takes their choice.  If you don't like that you're 
perfectly free to use reddit, stackoverflow or any other forum.

--
Kindest regards.

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


Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread breamoreboy
On Monday, January 1, 2018 at 9:35:06 PM UTC, Chris Angelico wrote:
> On Tue, Jan 2, 2018 at 7:16 AM, Chris Green wrote:
> > Dennis Lee Bieber wrote:
> >>
> >> Well... "break" does bypass the rest of the block, but it still 
> >> exits
> >> via the end of the block. I have a tendency to try for one "return" per
> >> procedure (so I'm more likely to have an "if ...: break" then "if ...:
> >> return").
> >
> > I have always tried to enforce 'only one return per function'.  If
> > there are multiple returns it makes maintenance very difficult as
> > 'clear up' code can get bypassed.
> >
> 
> Isn't that why try/finally exists? No matter how many 'return'
> statements you have, there's always exceptions to bypass any naive
> cleanup code; and no matter how many returns you have, 'finally'
> blocks still execute before return.
> 
> ChrisA

What happened to context managers?

--
Kindest regards.

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


Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread From
  




   (Posting On Python-List Prohibited)



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