[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-01 Thread Martin Panter

Martin Panter added the comment:

By “factory instance”, I presume you just mean a function (or class or method) 
that returns an appropriate object when called. (I think these are normally 
called “factory functions”. Instances are objects, the things that class 
constructors and factories return.)

What is being proposed? The best idea that I understand is hinted in 
. That is, to document and allow 
any function (not just a class or factory) to be passed as (or instead of) the 
RequestHandlerClass parameter.

This is a significant change to the documentation and API, but I would support 
it, and I think it should already be supported by the implementation.

The question of renaming the RequestHandlerClass parameter is a harder decision 
IMO. I think it would be easier to make the documentation clear that it is a 
misnomer and does not have to be a class. But in the long term, renaming the 
parameter seems nicer.

If it was “renamed”, we would first have to add a competing parameter, keep the 
old parameter around, consider adding deprecation warnings in 2020 when Python 
2 is dead, document both parameters, decide if anything should happen when both 
parameters are passed, etc. Much trickier, but possible. This renaming process 
is similar to “base64.encodestring” vs “encodebytes”, but more involved. I 
can’t think of an example where a function or constructor parameter was renamed 
like this.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29961] More compact sets and frozensets created from sets

2017-04-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Okay. I was going to provide patches for other set's weirdness (for example a 
set can increase its size after removing elements), but with your reaction I 
see that this doesn't make sense. I wash my hands from fixing set.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29446] Improve tkinter 'import *' situation

2017-04-01 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
keywords: +easy
stage: test needed -> needs patch
versions: +Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Steve D'Aprano
On Sun, 2 Apr 2017 12:42 pm, Rick Johnson wrote:

> On Saturday, April 1, 2017 at 9:18:14 PM UTC-5, Steve D'Aprano wrote:
> [...]
>> Even India has a literacy rate of 74%, which is not far off
>> the functional literacy rate in the US of 86%.
>>
>> http://www.huffingtonpost.com/2013/09/06/illiteracy-rate_n_3880355.html
> 
> And your source is the HuffPo? Seriously? 

No. My sources are the National Assessment of Adult Literacy, and the U.S.
Department of Education. HuffPo is just the middle man reporting the facts.

Hint: in the HuffPo article, you will see underlined phrases. These are
called "hyperlinks", or just "links", and clicking on some of them will
take you to the original source of the data.



>> The necessary encoding exists. Its called Unicode.
> 
> Great. Now let the evolutionary forces of the free market
> decide if it will live or die. Why do you feel compelled to
> intervene in this natural process?

I'm just as much a part of the "evolutionary forces of the free market" as
you. If you're allowed to complain about people using Unicode and loudly
rant about how its not necessary, I'm allowed to disagree.




-- 
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


[issue29961] More compact sets and frozensets created from sets

2017-04-01 Thread INADA Naoki

INADA Naoki added the comment:

OK, sorry about bothering you.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29961] More compact sets and frozensets created from sets

2017-04-01 Thread Raymond Hettinger

Raymond Hettinger added the comment:

You guys seem to have an enormous about of spare time and seem to feel to need 
to redesign every single thing you see.  Please slow down and allow me to 
breathe a bit.  I cannot keep up with a new "let's change x" every single day.  
This set object has been a successful design for a very long time.  I like the 
balance that it has struck and do not want to constantly mess with its tuning 
or parameters.

I working on bigger ideas at the moment that will make all of this irrelevant 
but can't make progress with you two proposing micro changes on an almost daily 
basis.

Please pick some actual bugs to go fix or implement a feature request to propel 
the language forward.  Eating up 100% of my development time is crippling my 
ability to contribute.  And I've grown weary of revisiting old ground over and 
over.  Please move on.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29961] More compact sets and frozensets created from sets

2017-04-01 Thread INADA Naoki

INADA Naoki added the comment:

I also feel set created from iterator is too large sometimes.
Especially, frozenset is used for "unordered tuple" dict key sometimes.

$ python -c 'N = 6000; from sys import getsizeof; s = 
[getsizeof(frozenset(range(n))) for n in range(N)]; print( [(n, s[n]) for n in 
range(N) if not n or s[n] != s[n-1]] )'
[(0, 224), (5, 736), (21, 2272), (85, 8416), (341, 32992), (1365, 131296), 
(5461, 524512)]

$ python -c 'N = 6000; from sys import getsizeof; s = 
[getsizeof(dict.fromkeys(range(n))) for n in range(N)]; print( [(n, s[n]) for n 
in range(N) if not n or s[n] != s[n-1]] )'
[(0, 240), (6, 368), (11, 648), (22, 1184), (43, 2280), (86, 4704), (171, 
9320), (342, 18528), (683, 36968), (1366, 73824), (2731, 147560), (5462, 
295008)]

set size increases by *4 each resize.
This is code of set_add_entry():

if ((size_t)so->fill*5 < mask*3)
return 0;
return set_table_resize(so, so->used>5 ? so->used*2 : so->used*4);

If we simply replace `so->used>5 ? so->used*2 : so->used*4` with 
`so->used*2`, there may be not enough room when there are some dummy entries. 
(used + dummy = fill).

But how about replacing `*4` with `*3`?
In general, load factor after resize will be changed from 12.5% ~ 25% to 16.6% 
~ 33.3%. It seems OK to me.
In case of no removal (e.g. constructor called with iterator), set size 
increases by *2 each time:

>>> for n in range(3, 20):
... print(math.ceil(2 ** n * 3/5) * 3, 2 ** (n+1))
15 16
30 32
60 64
117 128
231 256
462 512
924 1024
1845 2048
3687 4096
7374 8192
14748 16384
29493 32768
58983 65536
117966 131072
235932 262144
471861 524288
943719 1048576

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29941] Confusion between asserts and Py_DEBUG

2017-04-01 Thread Thomas Wouters

Thomas Wouters added the comment:


New changeset 553275d125478a6563dde7523f4f28c92f1861b4 by T. Wouters in branch 
'3.5':
bpo-29941: Assert fixes (#886) (#956)
https://github.com/python/cpython/commit/553275d125478a6563dde7523f4f28c92f1861b4


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-01 Thread Martin Panter

Martin Panter added the comment:

Underscores are only applicable to 3.6+, but the original concern about leading 
zeros applies to 3.5.

On Git Hub I suggested dropping the details and just referring to the Lexical 
Analysis section 
 
for the details.

FWIW here is my understanding of integer literals (with base=0):

* 0x10 => hexadecimal
* 0b10 => binary
* 0o10 => octal (corresponds to 010 in Python 2)
* 01 => illegal (avoids conflict with Python 2)
* 00 => zero (special case; was treated as octal zero in Python 2)
* 10 => decimal (must not start with digit 0)

If you want to spell out the rules, in my mind there are four special prefixes, 
0x, 0b, 0o and 0, and the default is decimal if none of those prefixes apply.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29941] Confusion between asserts and Py_DEBUG

2017-04-01 Thread Thomas Wouters

Thomas Wouters added the comment:


New changeset 90e3518225bafaff01469ed48c472ae7db5686f0 by T. Wouters in branch 
'3.6':
bpo-29941: Assert fixes (#886) (#955)
https://github.com/python/cpython/commit/90e3518225bafaff01469ed48c472ae7db5686f0


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26947] Hashable documentation improvement needed

2017-04-01 Thread Senthil Kumaran

Senthil Kumaran added the comment:

I have to admit, I did not see some of the negative votes in this ticket before 
merging the patch. If your is opposition is strong,  please comment and suggest 
a better improvement over the patch. thank you!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26947] Hashable documentation improvement needed

2017-04-01 Thread Senthil Kumaran

Senthil Kumaran added the comment:

I reviewed in the pull request. I agree that the wording was slightly better 
than the original.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5906] Risk of confusion in multiprocessing module - daemonic processes

2017-04-01 Thread Tim Peters

Tim Peters added the comment:

Again, I don't care about orphans.  In the usual cases people are running code 
with no concern about what happens in case of forced termination.  The only 
thing stopping it now is that the code goes out of its way to prevent it (or, 
alternatively, goes out of its way to force Pool workers to be daemonic).  So, 
e.g., people publish recipes for replacing multiprocessing.Pool to remove this 
restriction, like here:

http://stackoverflow.com/questions/6974695/python-process-pool-non-daemonic/8963618#8963618

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26947] Hashable documentation improvement needed

2017-04-01 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26947] Hashable documentation improvement needed

2017-04-01 Thread Senthil Kumaran

Senthil Kumaran added the comment:


New changeset a71a3ad54d14483cfaebd8e0fb96c97c798d9e32 by Senthil Kumaran in 
branch '3.6':
bpo-26947: DOC: clarify wording on hashable in glossary (#948) (#957)
https://github.com/python/cpython/commit/a71a3ad54d14483cfaebd8e0fb96c97c798d9e32


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26947] Hashable documentation improvement needed

2017-04-01 Thread Senthil Kumaran

Senthil Kumaran added the comment:


New changeset 51fc7e3d6a29de7b3142e51f8caf4d31f7ac72a0 by Senthil Kumaran in 
branch '3.5':
bpo-26947: DOC: clarify wording on hashable in glossary (#948) (#958)
https://github.com/python/cpython/commit/51fc7e3d6a29de7b3142e51f8caf4d31f7ac72a0


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26947] Hashable documentation improvement needed

2017-04-01 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
pull_requests: +1140

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Michael Torrie
On 04/01/2017 08:18 PM, Steve D'Aprano wrote:
>> And yet America continues to be emulated by 100% of the world.
> 
> Well, at least 100% of the world that you know of. Which isn't saying much.

I plonked RR a long time ago, but this little doozie requires a reply!
Having just traveled half way across the globe to two different
continents last month, I can say very clearly that those places do not
wish to or strive to emulate the US.  Especially lately with the
current, unprecedented level of belligerence emanating from its highest
office.  And certainly not in language... The countries I visited are
extremely proud of their languages and cultures.  Anyway, just wow.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26947] Hashable documentation improvement needed

2017-04-01 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
pull_requests: +1139

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26947] Hashable documentation improvement needed

2017-04-01 Thread Senthil Kumaran

Senthil Kumaran added the comment:


New changeset 64c887ab3a400cf91bde4f0c5ef69eacc88bc5e1 by Senthil Kumaran 
(csabella) in branch 'master':
bpo-26947: DOC: clarify wording on hashable in glossary (#948)
https://github.com/python/cpython/commit/64c887ab3a400cf91bde4f0c5ef69eacc88bc5e1


--
nosy: +orsenthil

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Rick Johnson
On Saturday, April 1, 2017 at 9:18:14 PM UTC-5, Steve D'Aprano wrote:
[...]
> Even India has a literacy rate of 74%, which is not far off
> the functional literacy rate in the US of 86%.
>
> http://www.huffingtonpost.com/2013/09/06/illiteracy-rate_n_3880355.html

And your source is the HuffPo? Seriously? With that in mind,
i think i'll wander on over to the TIOBE index and gawk at
the python position for a while. Gawd knows that google
searches and spam hits are the only true test for judging
the worthiness of programming language.

> The necessary encoding exists. Its called Unicode.

Great. Now let the evolutionary forces of the free market
decide if it will live or die. Why do you feel compelled to
intervene in this natural process?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread MRAB

On 2017-04-02 02:38, Rick Johnson wrote:

On Saturday, April 1, 2017 at 3:08:20 PM UTC-5, Mikhail V wrote:

On 1 April 2017 at 06:38, Rick Johnson  wrote:
> On Thursday, March 30, 2017 at 9:14:54 AM UTC-5, Steve D'Aprano wrote:

> > - and making band names look ǨØØĻ and annoy old fuddy-
> > duddies.
>
> So now we've even included graffiti artists in our little
> "inclusivity project". My, my... we are so _not_ mean!

Lol :)  First we'll wait for Unicode version with table-
drawing character for all possible corner styles and line
weights, and monospaced legible Arabic for Chris' MUDs.


Urm, don't mention MUDs around Chris. That's like a dog
whistle to him. He could go on and on for hours yelping
about them. To be honest, between his MUD ramblings and his
incessant plugging of the Pike language, i don't know which
is worse @_@.

But we tolerate Chris.


[snip]

Sometimes he mentions MUDs, sometimes he mentions Pike, but at least he 
doesn't rant.


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


[issue5906] Risk of confusion in multiprocessing module - daemonic processes

2017-04-01 Thread Eryk Sun

Eryk Sun added the comment:

> e.g., a Pool worker dies with an assert(!) error if it tries to create 
> its own Pool for something

A daemon process could create a child daemon when the OS can ensure that no 
orphans are left behind (e.g. call Linux prctl to set PR_SET_PDEATHSIG as 
SIGKILL). This would allow a pool worker to create another process pool.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Steve D'Aprano
On Sun, 2 Apr 2017 09:11 am, Rick Johnson wrote:

> The majority of the populations you reference are
> illiterate.

/face-palm

The majority of Chinese and Japanese are illiterate. Really?

Even India has a literacy rate of 74%, which is not far off the functional
literacy rate in the US of 86%.

http://www.huffingtonpost.com/2013/09/06/illiteracy-rate_n_3880355.html

(I know I'm comparing apples with oranges. But when 14% of the adult
population can *effectively* not read, despite being educated in the
wealthiest economy in the world, you don't get to point the finger at
other, poorer, countries and nations for their literacy problems.)


You're entitled to your own opinions, you're not entitled to your own facts.
Until you learn some actual facts, instead of the prejudices and self-
serving ignorance that you are currently operating on, your opinions are
based on fantasy, and you alternate between laughably obnoxious and just
obnoxious.


> Then create whatever encodings you so desire and then STFU about it.

The necessary encoding exists. Its called Unicode.


> Go request an audience from your beloved Queen Mother

My "beloved" Queen Mother? Oh dear, you really don't know me very well.

Besides, the old girl died in 2002.


> And yet America continues to be emulated by 100% of the world.

Well, at least 100% of the world that you know of. Which isn't saying much.



-- 
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: Temporary variables in list comprehensions

2017-04-01 Thread Chris Angelico
On Sun, Apr 2, 2017 at 11:53 AM, Steve D'Aprano
 wrote:
> Robert, I've asked you once to stop posting anti-Semitic signatures in your
> posts. You've now posted four times, and each one has included racist
> material in the signature.
>
> You are welcome to participate here if you discuss Python, or even to
> discuss general programming techniques, but if you continue to post
> anti-Semitic or other racist links and so-called "quotes" (usually invented
> or made up), you will be reported for a CoC violation and banned from the
> mailing list and kill-filed on the newsgroup.

If you were responding to something in this thread, I didn't even see
it, which quite possibly means he's already banned from the mailing
list.

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


Re: Temporary variables in list comprehensions

2017-04-01 Thread Steve D'Aprano
Robert, I've asked you once to stop posting anti-Semitic signatures in your
posts. You've now posted four times, and each one has included racist
material in the signature.

You are welcome to participate here if you discuss Python, or even to
discuss general programming techniques, but if you continue to post
anti-Semitic or other racist links and so-called "quotes" (usually invented
or made up), you will be reported for a CoC violation and banned from the
mailing list and kill-filed on the newsgroup.




On Sun, 2 Apr 2017 10:08 am, Robert L. wrote:

> I don't believe in western morality[...]
> archive.org/download/DavidDukeVideo/[...]


-- 
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: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Rick Johnson
On Saturday, April 1, 2017 at 3:08:20 PM UTC-5, Mikhail V wrote:
> On 1 April 2017 at 06:38, Rick Johnson  wrote:
> > On Thursday, March 30, 2017 at 9:14:54 AM UTC-5, Steve D'Aprano wrote:
>
> > > - and making band names look ǨØØĻ and annoy old fuddy-
> > > duddies.
> >
> > So now we've even included graffiti artists in our little
> > "inclusivity project". My, my... we are so _not_ mean!
>
> Lol :)  First we'll wait for Unicode version with table-
> drawing character for all possible corner styles and line
> weights, and monospaced legible Arabic for Chris' MUDs.

Urm, don't mention MUDs around Chris. That's like a dog
whistle to him. He could go on and on for hours yelping
about them. To be honest, between his MUD ramblings and his
incessant plugging of the Pike language, i don't know which
is worse @_@.

But we tolerate Chris.

In fact, noticing that Pike is statically typed, i'm
beginning to wonder if Chris may have poured pike oil in
GvR's ear thereby convincing him to introduce type-hints.

Whaddaya got next Chris, braces?

But the more i think about it, the more i realize the _true_
culprit of this type-hints conundrum may just be the Go
language. Sure, Ruby was the "classic foe", however, Ruby
was never a _real_ threat to Python. And not because Ruby
was an inferior language, but because Ruby did not
outshine Python. For both of their natural lives, Ruby and
Python have existed in their own little nitches, and so,
neither became an existential threat to the other. But then,
Google's pet language named "Go" arrived on the scene, and
now we had a statically typed compiled language with many of
the sugary syntactical features and intuitive structural
architecture of Python scripts. Go is basically an evolution
of Python, and when Guido first noticed Go he became
intimidated and then frightened, and so, hastily decided he
had to compete with it. And since he knew that true static
typing would be impossible in Python, he made the compromise
of implementing "type-hints". And so, now the entire
community has been saddled with this type-hints mess, just
because a few of his peers at Google-plex decided to give
Go, well, a go.

Our emotions can be powerful opponents. Sometimes, so
powerful, that even the wise cannot control them. Of course,
this is the same man who proudly claimed (when asked in an
interview if he would take a flight in a aeroplane that was
controlled by a dynamic language such as Python), "Yes!". Of
course, with the caveat that he would be allowed to "write
all the code himself".

But what kind person would make such a foolish claim?

And whether this loose thinking was a matter of overwhelming
emotions or just pure stupidity, has been hotly debated by
many people in community ever since. But, as for me, i don't
think the man is stupid -- no, the Python language stands as
a testament to his intellectual prowess -- however, my
observations have led me to believe that he's unable to
control his emotions. In fact, he is a man ruled by
emotions. His famously foolish and braggadocious claim
exposes a deeply inflated sense of his own abilities brought
to the surface by powerful feelings of superiority over
others. He believes himself infallible. Could this be a
result of malignant narcissism? Megalomania? Possibly all
the above sprinkled lightly with sadistic tendencious? Who
knows...

I'm not sure if our dear leader has conceded to the foolish
nature of his famous "Python Drone Idea", but what i am sure
of, is that the existence of type-hints is evidence of his
emotions (once again!) overriding his rational mind and
causing him to make a poor decision.

Last time it was pride.

This time it is jealously.

What will it be next time?

He is a man who is unable to be humble in the reality of his
own accomplishments, and unable to concede that his
intellectual powers are merely that of a mortal. Powers that
are subject to fallibility and stubborn headedness. Powers
that cannot reach full potential unless they are
supplemented by a strong and open community.

This realization is for me, and many in this fine community,
both sad and terrifying. It is as though we are witnessing a
beloved relative slowly drift away into the clutches of
dementia. Racked with horrific pain and dehumanized by the
embarrassing bouts of incontinence. And we are powerless to
do anything to stop it. And although we'd rather hold our
noses and look away, we cannot. It is a strange irony that
we are forced by a "sense of duty" to become unwilling
spectators to this downward spiral.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Mikhail V
On 2 April 2017 at 02:01, Chris Angelico  wrote:
> On Sun, Apr 2, 2017 at 9:25 AM, Mikhail V  wrote:
>> On 2 April 2017 at 00:22, Chris Angelico  wrote:
>>> On Sun, Apr 2, 2017 at 8:16 AM, Mikhail V  wrote:
 For multiple-alphabet rendering I will use some
 custom text format, e.g. with tags
 

[issue5906] Risk of confusion in multiprocessing module - daemonic processes

2017-04-01 Thread Tim Peters

Tim Peters added the comment:

@Eryk, not me ;-)  I find the "daemonic or not?" distinction useless for 
processes - it just gets in the way at times (e.g., a Pool worker dies with an 
assert(!) error if it tries to create its own Pool for something).

I don't care about orphans either.

It's one reason `concurrent.futures.ProcessPoolExecutor` is sometimes more 
attractive (it has no "daemon" concept, the processes it creates don't vanish 
midstream at sometimes surprising times, and neither do they refuse to create 
additional cf process pools).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



net-snmp-python

2017-04-01 Thread Matt
Does anyone have an example of using netsnmp library to do a snmpset
on a snmp v2 device?  I have gotten snmpget to work fine with python I
just cannot get snmpset to work.  I know I have the snmp device
configured correctly with read/write access since I can use snmpset on
the linux(centos7) command line to successfully make changes to the
device.

This is on python 2.7.5 stock version included with Centos 7.

The below works fine to do a snmpwalk but I need to do a snmpset on
different variable.

import netsnmp

oid = netsnmp.Varbind('sysDescr')

result = netsnmp.snmpwalk(oid,
  Version = 2,
  DestHost="localhost",
  Community="public")

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


[issue5906] Risk of confusion in multiprocessing module - daemonic processes

2017-04-01 Thread Eryk Sun

Eryk Sun added the comment:

> I've personally found this `multiprocessing` restriction (daemonic 
> processes can't have children) to be nothing but a pain in the ass 

To make that reliable on Windows you could create a silent-breakaway, 
kill-on-close Job object in each process for its daemon children. Closing the 
job handle would cascade terminate all descendant daemon processes in that 
branch of the process tree, i.e. when a process is terminated it closes the Job 
handle, which terminates all of its daemon children, which closes their Job 
handles, which terminates all of their daemon children, and so on. Non-daemons 
would still be orphaned when the parent is terminated.

--
nosy: +eryksun

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Chris Angelico
On Sun, Apr 2, 2017 at 9:25 AM, Mikhail V  wrote:
> On 2 April 2017 at 00:22, Chris Angelico  wrote:
>> On Sun, Apr 2, 2017 at 8:16 AM, Mikhail V  wrote:
>>> For multiple-alphabet rendering I will use some
>>> custom text format, e.g. with tags
>>> 

[issue29941] Confusion between asserts and Py_DEBUG

2017-04-01 Thread Thomas Wouters

Changes by Thomas Wouters :


--
pull_requests: +1138

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29941] Confusion between asserts and Py_DEBUG

2017-04-01 Thread Thomas Wouters

Changes by Thomas Wouters :


--
pull_requests: +1137

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: VirtualEnvs (venv) and Powershell

2017-04-01 Thread eryk sun
On Sat, Apr 1, 2017 at 12:03 AM, Carl Caulkett  wrote:
> I've just started to investigate VirtualEnvironments as a means of
> preventing my 3rd party code becoming chaotic. I've discovered that
> venv's can be managed quite effectively using Powershell. When
> Activate.ps1 is run, the PowerShell changes to indicate that the venv
> is active which is nice. However despite the official documention,
> there doesn't seem to be a corresponding Deactivate.ps1. There is a
> deactivate.bat but that doesn't appear to switch the paths back to
> their pre-env state.

Please read the contents of Activate.ps1. The way the `deactivate`
function works should be obvious.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Mikhail V
On 2 April 2017 at 00:22, Chris Angelico  wrote:
> On Sun, Apr 2, 2017 at 8:16 AM, Mikhail V  wrote:
>> For multiple-alphabet rendering I will use some
>> custom text format, e.g. with tags
>> 

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Rick Johnson
On Saturday, April 1, 2017 at 11:01:03 AM UTC-5, Steve D'Aprano wrote:
> On Sat, 1 Apr 2017 12:17 pm, Rick Johnson wrote:
> 
> > Most people just quietly change the filename and move on
> 
> There are over a billion people in China, almost a billion
> more in India, about 140 million people in Russia, nearly
> 130 million people in Japan, 250 million in Indonesia,
> about 290 million native Arabic speakers, and even 9
> million speakers of Hebrew.  If you think that all these
> people, and hundreds of millions more, will just "quietly
> change the filename"

The majority of the populations you reference are
illiterate. Have you ever seen the endless slums in India?

> To say nothing of the hundreds of millions who use Latin
> character sets that ASCII cannot handle, including around
> 65 million British.  Open your eyes, there is a whole world
> past the borders of your insular, close-minded little
> country.

Then create whatever encodings you so desire and then STFU
about it. Why are you whining to me? Contrary to your
beliefs, America does not exist to satisfy the whims of non-
americans. If you are British, then America does not exist
for you. Go request an audience from your beloved Queen
Mother; and if she's too busy, perhaps Mother Mary will
entertain you; and if she's too busy,  there is always Sir
Paul McCartney to sing you a lullaby. And since he's not
toting around that one legged girl anymore, he probably has
quite a bit of free time, even for someone as unimportant as
you.

When i find myself in times of trouble,
Mother ASK-EEE comes to me,
Speaking codes of pragmatism, 
let it be
And when the broken hearted people,
Living in the world agree,
There will be an answer -> "ASS-KEE"
For though they may be parted
There is still a chance that they will see
There will be an answer -> "ASK__EEE"
ASS-KEE, ASS-KEE, Oh ASS-KEE, ASS-KEE
There will be an answer -> "ASS-KEE"
 
Hey, Steve!
Don't be so sad,
We'll take a bad encoding, 
And make it bettuh!

Because we're 'mericans. 

And failure is not an option.

> 95% of the world is not American, 

And yet America continues to be emulated by 100% of the
world. A small country that has hardly existed for a few
hundred years, has not only created a social transformation
that has reverberanted around the world, we continue to define
popular culture. If you hate us so much, then why do you try
so much to emulate us?

> and there are millions of Americans who want to use non-
> ASCII characters in their file names, even non-Latin
> characters.

Great. More reason for you to create your beloved encoding
so you can become their hero. Perhaps you can convince a
remote island tribe to worship you as god.

> You talk about a fraction of that 5%, the tiny minority who
> care only about ASCII, and describe them as "most people".

Most people don't even know what Unicode and ASCII are, and
even if you had the time to educate them, they could care
less. I'm talking about technical folk, not idiots off the
street; i'm talking about people who write software and
advanced users of technical softwares; not some drooling
twit who downloaded the latest version of angry birds from
the apple store.

> That demonstrates the smallness of your world-view and the
> enormity of your ignorance. Wake up. The world is not
> Smallville USA, it never has been, and never will be.
> Either adapt, or get out of the way of those who have.

I am more than willing to provide whatever features the
_majority_ of my clients request, but what i am not willing
to do, is expend my labor capital on your pet social justice
project that caters to large concentrations of illiterates
and non-technical folk. *YOU* may ascribe to the religion of
imperialism, but i do not; if i am to ascribe to any
religion, that religion would be pragmatism. And even if we
cull the geographic Set you provided to include only the
literates of that Set, it would simply be impractical for
small or even medium sized developers to devote the time
needed to cater to all those foreign markets.

Does that mean i don't care about these people -- no. 

Does that mean i look down on these people -- no. 

It just means that my time is very important to me. 

And for you to suggest that those who do not support your
pet "inclusivity project" are intolerant (or whatever
pejorative you want to use), well, that discloses more about
your personality than does it mine. So let the bright lads
in those counties rise up and provide their own people with
great localized products. My market includes the entire
Western culture; spanning multiple continents and even some
of the more advanced areas of the undeveloped nations you
mentioned. That's a large enough market to make billions.
Why should i take anymore?

Sheesh. Out of one side your face you people whine because
major american corporations like Mcdonalds and Coca-Cola
have invaded just about every market on the face of the

[issue26947] Hashable documentation improvement needed

2017-04-01 Thread Martin Panter

Martin Panter added the comment:

The pull request currently suggests “All of Python’s immutable built-in objects 
are hashable; mutable containers (such as lists or dictionaries) are not.” This 
seems better wording than the original.

FWIW, I would have tried “Python’s built-in immutable objects are hashable, 
while mutable containers (such as lists and dictionaries) are not hashable.”

--
nosy: +martin.panter
title: Documentation improvement needed -> Hashable documentation improvement 
needed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: VirtualEnvs (venv) and Powershell

2017-04-01 Thread Cameron Simpson

On 31Mar2017 19:03, Carl Caulkett  wrote:

I've just started to investigate VirtualEnvironments as a means of
preventing my 3rd party code becoming chaotic. I've discovered that
venv's can be managed quite effectively using Powershell. When
Activate.ps1 is run, the PowerShell changes to indicate that the venv
is active which is nice. However despite the official documention,
there doesn't seem to be a corresponding Deactivate.ps1. There is a
deactivate.bat but that doesn't appear to switch the paths back to
their pre-env state.
  What I would really like is a Git-Bash based alternative to
Powershell to manage my Virtual Environments. Has anyone dicovered
tools or techniques to achieve this?


Well, in a UNIX environment the natural things is simply to start a shell using 
the target venv. Thus:


 sh -c '. /path/to/the/venv/bin/activate; exec $SHELL'

or even simpler:

 ( . /path/to/the/venv/bin/activate; exec $SHELL )

That would get you a prompt using the virtualenv by default. To reset to the 
old settings, exit that subshell.


Maybe I misunderstand your needs.

Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-01 Thread Dominic Mayers

Dominic Mayers added the comment:

Oops, I did not realize that David was one of the developers. Well, may be this 
needs the attention of more than one developer.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



python installs on OSX missing dbm.gnu

2017-04-01 Thread Cameron Simpson
I've got three different installs of Python 3.6.1 on my El Capitan Mac: 
MacPorts, homebrew and the .pkg from python.org.


For reasons I haven't divined, the homebrew and MacPorts ones abort with malloc 
related errors. So I went to install the distro from python.org, which happily 
does not.


However, both the homebrew and python.org installs lack "dbm.gnu", upon which 
my main project relies. Well, fair enough.


However, I do not know how to make it available to either. MacPorts has a 
py36-gdbm package which binds the gdbm library to Python. homebrew seems not to 
have such a thing and of course the python.org install is standalone.


PyPI seems not forthcoming either.

What should I be doing about this?

Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Chris Angelico
On Sun, Apr 2, 2017 at 8:16 AM, Mikhail V  wrote:
> For multiple-alphabet rendering I will use some
> custom text format, e.g. with tags
> 

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Mikhail V
On 1 April 2017 at 18:00, Steve D'Aprano  wrote:
> On Sat, 1 Apr 2017 12:17 pm, Rick Johnson wrote:
>
>> Most people just quietly change the filename and move on
>
>
> There are over a billion people in China, almost a billion more in India,
> about 140 million people in Russia, nearly 130 million people in Japan, 250
> million in Indonesia, about 290 million native Arabic speakers, and even 9
> million speakers of Hebrew.
>

Well, this is obvious, different characters in different
parts of the world, ministries of education, etc.
But will the sky fall if people name files using
latin letters? Look, I am Russian, nothing to do
with Ugly American :)
At my work I quietly change all filenames to translit.
This is for _simplification_ of all automation processes and
some other purposes. It makes my work with digital
materials seamless and as a positive side-effect makes
it easier for external service-providers to avoid
different surprises.
So it is _not_ in the first place because some software
cope badly with unicode, but because it is natural
and logical to use same glyphs for any language
(but strangely, many have difficulties with understanding
this, well.. the time has not come yet, let's wait few
hundreds years more)

BTW, why do you think people in China do not
want to use latin letters? I suppose there are a lot
of haters for those bizarre systems among natives
and indeed, many people stay illiterate simply
because it is too hard to learn and many
have problems reading those.

Let's go back in Europe, e.g. in Germany there were
many movements against those silly spelling rules and
many younger people ignore those in informal writing,
e.g. they write 'were' intead of 'wäre', 'fur' instead of 'für'
and do not capitalise nouns, and they are damn right about it.

So this all is just your personal view on the problem.

This reminds me of one anecdote:
A Pole and a Russian talk about languages:
Russian: our language is better, we have more
letters in our alphabet!
Pole: no, ours is better - we have more grammatical
cases!

Also I never install any language packages with software
and use only english versions, anyway most tutorials
will be in english and one can't force developers to
make turorials with screenshots for all languages.
And english UI looks for me always better and more intuitive.

> One of the excellent ways the PUAs have been used is by
> medieval researchers. They have been collecting the various
> special characters used by medieval scribes, and by private
> agreement putting them into a PUA area where special
> purpose software can use it. That way they can determine
> which of the thousands of special characters used by
> medieval monks are actually significant enough to graduate
> to genuine Unicode characters, and which are best handled
> some other way.

Now I don't see who wrote this ^ initially. Suppose Steve?
So IMO this is not an 'exellent' way. If I want to
make e.g. analysis of Voynich manuscript, I'll do
following: extract/draw glyphs and encode them,
say with integers 0..26.
And all rendering and analysis will be performed on
those integers.
For multiple-alphabet rendering I will use some
custom text format, e.g. with tags

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-01 Thread Dominic Mayers

Dominic Mayers added the comment:

The reason why I feel we should not make it immediately a documentation issue 
is that I don't know how a person working on documentation could proceed ahead 
without a clear go ahead signal from developers. In that sense,  having a 
documentation that says that the variable name does not reflect its intent 
seems tricky. It's very easy to change a variable name. It cannot possibly 
break the code, except for a collision, but they are easy to avoid.  If we 
don't have the interest of developers, not even for a simple renaming, I don't 
see a go ahead signal in this.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Chris Angelico
On Sun, Apr 2, 2017 at 7:49 AM, Stefan Ram  wrote:
> Chris Angelico  writes:
>>Yes it can; however, there is no way within Python to have a string
>>that can represent two strings, which is what directory separators do.
>
>   To represent two strings, /internally/ ("within Python"),
>   a straightforward way would be a list of two strings.
>
>   If one wants to represent this list /as a single string/,
>   one can use any serialization of this list, for example,
>   using JSON.
>
>   (I have not read the whole thread, so I might have missed
>   some context here. I am just responding to what is quoted
>   above.)

The context is a file name, in which you need something that a user
can input which is capable of representing path components that
contain arbitrary characters. Currently, a Unix path always interprets
a slash as a directory separator, so there's no way to have a slash in
a file or directory name. If you want to have *every* component
capable of containing *any* character, you either need a string to be
able to represent two strings, or you need some sort of escaping
mechanism.

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


Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Chris Angelico
On Sun, Apr 2, 2017 at 7:35 AM, Marko Rauhamaa  wrote:
> Chris Angelico :
>
>> there is no way within Python to have a string that can represent two
>> strings, which is what directory separators do.
>
> Really? Try:
>
>>>> repr(("a", "b"))
>"('a', 'b')"
>
> There! A string that represents two strings.

In the arbitrary sense that you can encode anything in any way and
then treat it as a string, yes, of course you can devise a system that
lets you represent two strings. But you were talking about the nature
of the string literal in Python, and what you have here is not a
string literal - it's a tuple. You do NOT want to allow file names to
be arbitrary code, nor even "something acceptable by
ast.literal_eval"; they should be simple strings. Otherwise, there's
no point even having them - just use file reference numbers (eg
inodes) instead, and force people to select them from a GUI menu every
time they want to work with a file.

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


Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Mikhail V
On 1 April 2017 at 22:57, Chris Angelico  wrote:
> On Sun, Apr 2, 2017 at 6:07 AM, Mikhail V  wrote:
>> On 1 April 2017 at 06:38, Rick Johnson  wrote:
>>> On Thursday, March 30, 2017 at 9:14:54 AM UTC-5, Steve D'Aprano wrote:
>>
 - and making band names look ǨØØĻ and annoy old fuddy-
 duddies.
>>>
>>> So now we've even included graffiti artists in our little
>>> "inclusivity project". My, my... we are so _not_ mean!
>>
>> Lol :)  First we'll wait for Unicode version with
>> table-drawing character for all possible corner styles
>> and line weights, and monospaced legible Arabic for
>> Chris' MUDs.
>
> Not sure what you mean by monospaced, given that Arabic is RTL anyway.
> I mean, when your code is capable of handling all the oddities of
> mixed LTR and RTL text, variable-width characters are almost trivially
> easy to handle. (And yes, I do indeed handle them just fine.)

Monospaced text = each glyph appears in a constant-width
box (the whole thread is about this). Nothing to do with writing
direction.
Both Windows and Linux default console renders monospaced
text only. Unless you use something else, which can render
both monospaced and proportional text, Arabic is
not adequatly presentable there. Eg alef's width is ca 0,2 sheen's width.
So one gets piles of poo instead of normal Arabic text in console.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Marko Rauhamaa
Chris Angelico :

> there is no way within Python to have a string that can represent two
> strings, which is what directory separators do.

Really? Try:

   >>> repr(("a", "b"))
   "('a', 'b')"

There! A string that represents two strings.

Note, however, that Python programs generally don't restrict themselves
to expressing objects via strings. There are even objects with no string
representation at all.

A pathname is a list of strings. Python could naturally express it as
just that:

  [ "usr", "bin", "python3" ]


I'm not really proposing any change to the status quo. What's done is
done. However, I do think it is awkward to ban one particular, very
common character while allowing all the rest.


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


Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Chris Angelico
On Sun, Apr 2, 2017 at 7:06 AM, Marko Rauhamaa  wrote:
> Chris Angelico :
>
>> On Sun, Apr 2, 2017 at 6:47 AM, Marko Rauhamaa  wrote:
>>> A far more convenient escaping scheme could have been devised for
>>> pathnames.
>>
>> Definitely. We should treat file names like domain names. "Bücher.ch"
>> gets represented internally as "xn--bcher-kva.ch". That would solve
>> all the problems, and there's no way that it could create more.
>
> Note that Python can express any text string, including one with a quote
> character. I don't know if Python's escaping scheme is creating more
> problems than it is solving.

Yes it can; however, there is no way within Python to have a string
that can represent two strings, which is what directory separators do.
Ultimately, all you really get by referencing Python's string literals
is an escaping system: "\\" for a backslash, and then you can use "\?"
for various special symbols to change their meaning.

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


Re: sorting list python

2017-04-01 Thread Robert L.
On 1/18/2017, Peter Otten wrote:

> with partite.txt looking like this
> 
> > 74' Kessie'
> > 90' + 4' D'alessandro
> > 51' Mchedlidze
> > 54' Banega
> > 56' Icardi
> > 65' Icardi
> > 14' Sau
> 
> 
> Assuming you want to perform a numerical sort on the numbers before the ' 
> you can just apply sorted
> 
> with open(...) as f:
> print("".join(sorted(f))
> 
> as long as all number strings have the same length. 
> 
> If that's not the case python's sorted() has decorate-sort-undecorate 
> capabilities built in -- no need to do it manually:
> 
> with open("partite.txt") as f:
> by_number = sorted(f, key=lambda line: int(line.partition("'")[0]))
> print("".join(by_number))

puts IO.readlines('foo.txt').sort_by( &:to_i )

14' Sau
51' Mchedlidze
54' Banega
56' Icardi
65' Icardi
74' Kessie'
90' + 4' D'alessandro
==>nil

-- 
Jews totally run Hollywood  But I don't care if Americans think we're
running the news media, Hollywood, Wall Street, or the government.  I just care
that we get to keep running them. --- Joel Stein
articles.latimes.com/2008/dec/19/opinion/oe-stein19
archive.org/download/DavidDukeTv/DoJewsControlTheMediaTheLaTimesSaysYes.flv
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Marko Rauhamaa
Chris Angelico :

> On Sun, Apr 2, 2017 at 6:47 AM, Marko Rauhamaa  wrote:
>> A far more convenient escaping scheme could have been devised for
>> pathnames.
>
> Definitely. We should treat file names like domain names. "Bücher.ch"
> gets represented internally as "xn--bcher-kva.ch". That would solve
> all the problems, and there's no way that it could create more.

Note that Python can express any text string, including one with a quote
character. I don't know if Python's escaping scheme is creating more
problems than it is solving.


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


[issue29763] test_site failing on AppVeyor

2017-04-01 Thread Zachary Ware

Changes by Zachary Ware :


--
pull_requests: +1136

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Chris Angelico
On Sun, Apr 2, 2017 at 6:47 AM, Marko Rauhamaa  wrote:
> You are stuck with the axiom that pathname and its representation are
> one and the same thing.
>
> URI's make the distinction clear. Say you wanted to express a resource
>
>päätyö/2
>
> as part of a URI. URIs are to contain a subset of ASCII only so an
> encoding scheme has been devised. That resource is expressed like this:
>
>p%c3%a4%c3%a4ty%c3%b6%2f2
>
> A far more convenient escaping scheme could have been devised for
> pathnames.

Definitely. We should treat file names like domain names. "Bücher.ch"
gets represented internally as "xn--bcher-kva.ch". That would solve
all the problems, and there's no way that it could create more.

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


[issue29960] _random.Random state corrupted on exception

2017-04-01 Thread Bryan G. Olson

Changes by Bryan G. Olson :


--
pull_requests: +1135

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Chris Angelico
On Sun, Apr 2, 2017 at 6:07 AM, Mikhail V  wrote:
> On 1 April 2017 at 06:38, Rick Johnson  wrote:
>> On Thursday, March 30, 2017 at 9:14:54 AM UTC-5, Steve D'Aprano wrote:
>
>>> - and making band names look ǨØØĻ and annoy old fuddy-
>>> duddies.
>>
>> So now we've even included graffiti artists in our little
>> "inclusivity project". My, my... we are so _not_ mean!
>
> Lol :)  First we'll wait for Unicode version with
> table-drawing character for all possible corner styles
> and line weights, and monospaced legible Arabic for
> Chris' MUDs.

Not sure what you mean by monospaced, given that Arabic is RTL anyway.
I mean, when your code is capable of handling all the oddities of
mixed LTR and RTL text, variable-width characters are almost trivially
easy to handle. (And yes, I do indeed handle them just fine.)

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


[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-01 Thread R. David Murray

R. David Murray added the comment:

Given how old socket server is, and that it doesn't actually require that API, 
we should probably just reword the documentation so that it is clear that 
RequestHandlerClass is the default Handler implementation (and that you can 
work with setup/handle/finish if you want to subclass it), and document what 
the *actual* requirements on the Handler are.  

We are unlikely to change socketserver's actual API at this point.

I don't think there's any need for a new issue, let's just make this a 
documentation issue.  The original title still even applies :)  We will need 
signoff from someone with more direct interest in the socketserver module than 
me, but given that the "future" for the stuff socketserver handles is asyncio, 
I suspect the only objection we might get is "it's not worth it".  But if 
someone wants to do the work, *I* don't see a reason to reject it.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
stage: resolved -> 
type: enhancement -> behavior
versions: +Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Marko Rauhamaa
Steve D'Aprano :

> But if I could borrow Guido's time machine, I'd go back and convince
> the file system people to use ^ as the record separator, rather than
> slash or backslash or colon. Caret is *much* less likely to be useful
> in file names than forward slash (often used for dates) or colon, or
> even backslash.

You are stuck with the axiom that pathname and its representation are
one and the same thing.

URI's make the distinction clear. Say you wanted to express a resource

   päätyö/2

as part of a URI. URIs are to contain a subset of ASCII only so an
encoding scheme has been devised. That resource is expressed like this:

   p%c3%a4%c3%a4ty%c3%b6%2f2

A far more convenient escaping scheme could have been devised for
pathnames.


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


[issue29162] pyshell.py: name 'sys' is not defined

2017-04-01 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The follow-up tkinter import issue is #29446

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-01 Thread R. David Murray

R. David Murray added the comment:

Well, we could document it as a factory argument, and explain that the argument 
name is an historical artifact.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29339] Interactive: Move to same indentation level as previousline

2017-04-01 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
resolution:  -> rejected
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: How to flatten only one sub list of list of lists

2017-04-01 Thread Robert L.
On 3/1/2017, Sayth Renshaw wrote:

> How can I flatten just a specific sublist of each list in a list of lists?
> 
> So if I had this data
> 
> 
> [   ['46295', 'Montauk', '3', '60', '85', ['19', '5', '1', '0 $277790.00']],
> ['46295', 'Dark Eyes', '5', '59', '83', ['6', '4', '1', '0 $105625.00']],
> ['46295', 'Machinegun Jubs', '6', '53', '77', ['6', '2', '1', '1 
> $71685.00']],
> ['46295', 'Zara Bay', '1', '53', '77', ['12', '2', '3', '3 $112645.00']]]
> 
> 
> How can I make it be
> 
> 
> [   ['46295', 'Montauk', '3', '60', '85', '19', '5', '1', '0 $277790.00'],
> ['46295', 'Dark Eyes', '5', '59', '83', '6', '4', '1', '0 $105625.00'],
> ['46295', 'Machinegun Jubs', '6', '53', '77', '6', '2', '1', '1 
> $71685.00'],
> ['46295', 'Zara Bay', '1', '53', '77', '12', '2', '3', '3 $112645.00']]
> 
> Been looking around but most solutions just entirely flatten everything.
> This was popular on SO but yeah it flattens everything  I want to be more 
> selective
> 
> def flatten(lst):
> for elem in lst:
> if type(elem) in (tuple, list):
> for i in flatten(elem):
> yield i
> else:
> yield elem
> 

[['46295', 'Montauk', '3', '60', '85', ['19', '5', '1', '0 $277790.00']],
 ['46295', 'Dark Eyes', '5', '59', '83', ['6', '4', '1', '0 $105625.00']],
 ['46295', 'Machinegun Jubs', '6', '53', '77', ['6', '2', '1', '1 $71685.00']],
 ['46295', 'Zara Bay', '1', '53', '77', ['12', '2', '3', '3 $112645.00']]].
map( &:flatten )

 ===>
[["46295", "Montauk", "3", "60", "85", "19", "5", "1", "0 $277790.00"],
 ["46295", "Dark Eyes", "5", "59", "83", "6", "4", "1", "0 $105625.00"],
 ["46295", "Machinegun Jubs", "6", "53", "77", "6", "2", "1", "1 $71685.00"],
 ["46295", "Zara Bay", "1", "53", "77", "12", "2", "3", "3 $112645.00"]]

-- 
[T]he driving force behind mass immigration is the organized Jewish community,
which feels its interests are best served by a "diverse" society divided
between antagonistic groups that can be easily dominated by their cohesive and
privileged tribe.
http://www.renseradioarchives.com/dduke/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Mikhail V
On 1 April 2017 at 06:38, Rick Johnson  wrote:
> On Thursday, March 30, 2017 at 9:14:54 AM UTC-5, Steve D'Aprano wrote:

>> - and making band names look ǨØØĻ and annoy old fuddy-
>> duddies.
>
> So now we've even included graffiti artists in our little
> "inclusivity project". My, my... we are so _not_ mean!

Lol :)  First we'll wait for Unicode version with
table-drawing character for all possible corner styles
and line weights, and monospaced legible Arabic for
Chris' MUDs.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue28157] Document time module constants (timezone, tzname, etc.) as deprecated.

2017-04-01 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +1134

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Spam user

2017-04-01 Thread Mario R. Osorio
I'm not in the business of starting an argument about best/worse newsreader, 
Ammammata, but could you please recommend a few?

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


Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread MRAB

On 2017-04-01 17:43, Marko Rauhamaa wrote:

Steve D'Aprano :


Open your eyes, there is a whole world past the borders of your insular,
close-minded little country. 95% of the world is not American, and there
are millions of Americans who want to use non-ASCII characters in their
file names, even non-Latin characters.


It would be nice to be able to use a / in my file names. Funny enough,
I'm allowed to use a zillion unprintable characters in my file names but
no slashes allowed.

Example:

   results-Q2/2017.json



Try this instead:

results-Q2∕2017.json

:-)

(It's U+2215 "DIVISION SLASH").
--
https://mail.python.org/mailman/listinfo/python-list


Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread eryk sun
On Sat, Apr 1, 2017 at 5:38 PM, Steve D'Aprano
 wrote:
> Or, for Windows, I suppose a dozen or so more characters:
>
> https://support.office.com/en-us/article/Invalid-characters-in-file-or-folder-names-or-invalid-
> file-types-in-OneDrive-for-Business-64883A5D-228E-48F5-B3D2-EB39E07630FA

It's more than a dozen reserved characters. If we're strictly
following the file-system runtime library conventions, then all ASCII
control characters (0-31) are reserved as well as pipe; the path
separators slash, backslash, and colon (named streams); and the
wildcard characters asterisk, question mark, less than, greater than,
and double quote.

Except for backslash, which is reserved by the object manager, these
reservations are imposed by the FsRtl, and in theory I think a custom
file system *could* ignore this. This would require using the \\?\
prefix and, in some cases, it would also require applications to use
the native NT API in order to avoid DOS conventions. It would also
need some private escape sequence to tell the file system, for
example, that an asterisk in a directory listing filter isn't supposed
to be a wildcard. These constraints would be too cumbersome,
confusing, and unworkable in general, so the system's use would
probably need to be restricted to a specific set of applications or an
NT subsystem that can hide the implementation details.

For a real-world example, the Linux subsystem in Windows 10 (WSL)
stores the POSIX namespace files that it creates using regular files
in a hidden folder in the user's profile. It has to escape characters
that are reserved:

$ touch 'test*?<>":\|.txt'

C:\>dir /b %localappdata%\lxss\home\%username%\test*
test#002A#003F#003C#003E#0022#003A#005C#007C.txt
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Tim Chase
On 2017-04-01 19:43, Marko Rauhamaa wrote:
> It would be nice to be able to use a / in my file names. Funny
> enough, I'm allowed to use a zillion unprintable characters in my
> file names but no slashes allowed.
> 
> Example:
> 
>results-Q2/2017.json

You can:

  $ touch $(/usr/bin/printf "results-Q2\u22152017.")


Now, whether one would find it *prudent*, that's another matter. ;-)

-tkc





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


Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Tim Chase
On 2017-04-02 03:09, Steve D'Aprano wrote:
> *Whatever* record separator you choose to use, whether it is
> slash / or backslash \ or colon : or Ctrl-^ RS or U+113A HANGUL
> CHOSEONG SIOS-PHIEUPH, you can't *also* use it as a non-record
> separator.

Well, one could use 0x1C (FS=File Separator) which at least has the
semantic meaning and would be far less likely to be desired in
file-names.

That said, I'm not sure I want to try and enter 0x1C every time I
intend to compose a complex path.  But that's an interface problem,
right? ;-)

-tkc



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


[issue5906] Risk of confusion in multiprocessing module - daemonic processes

2017-04-01 Thread Tim Peters

Tim Peters added the comment:

I'll take a crack at these ancient comments ;-)

"""
daemon
The process’s daemon flag, a Boolean value. This must be set before start() 
is called.
The initial value is inherited from the creating process. [1]
When a process exits, it attempts to terminate all of its daemonic child 
processes. [2]

[1] this sentence is weird: since daemonic processes are not allowed to have 
children, isn't this flag always False in a new Process instance ?
"""

Yes.  I agree it's confusing; looks like it was pasted from the `threading` 
docs a long time ago, in which context it had a non-degenerate meaning.

I've personally found this `multiprocessing` restriction (daemonic processes 
can't have children) to be nothing but a pain in the ass, especially since 
`Pool` worker processes are (although this doesn't appear to be documented) 
created as daemonic processes.  (Note that 
`concurrent.futures.ProcessPoolExecutor` doesn't have this restriction.)

"""
[2] typo, it meant "all of its NON-daemonic child processes" instead, didn't it 
?
"""

No, this was correct.  When a process exits, it waits to join its non-daemonic 
children, but brutally terminates its daemonic children midstream.  For 
example, run this:

import multiprocessing as mp
from time import sleep

def e(tag):
for i in range(10):
print(tag, i)
sleep(1)

if __name__ == '__main__':
p = mp.Process(target=e, args=("daemon",), daemon=True)
q = mp.Process(target=e, args=("normal",))
p.start()
q.start()
sleep(5)

You'll see that, after 5 seconds, the main process exits and terminates the 
daemonic process immediately, but waits for the non-daemonic process to finish:

daemon 0
normal 0
daemon 1
normal 1
daemon 2
normal 2
daemon 3
normal 3
daemon 4
normal 4
normal 5
normal 6
normal 7
normal 8
normal 9

--
nosy: +tim.peters

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Steve D'Aprano
On Sun, 2 Apr 2017 03:18 am, Alain Ketterlin wrote:

> Marko Rauhamaa  writes:
> 
>> It would be nice to be able to use a / in my file names. Funny enough,
>> I'm allowed to use a zillion unprintable characters in my file names but
>> no slashes allowed.
>>
>> Example:
>>
>>results-Q2/2017.json
> 
> Use U+2215 (DIVISION SLASH).

That is *deliciously* evil. I like it.
 
> I have tried this once. "Next time you're fired/dead" (and less pleasant
> variants) was the only comment I got from people I shared files with.

:-)

∕home∕steve∕document


I'm sure you deserved everything they did to you :-)





-- 
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: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Steve D'Aprano
On Sun, 2 Apr 2017 03:08 am, Marko Rauhamaa wrote:

> Chris Angelico :
> 
>> On Sun, Apr 2, 2017 at 2:43 AM, Marko Rauhamaa  wrote:
>>> It would be nice to be able to use a / in my file names. Funny
>>> enough, I'm allowed to use a zillion unprintable characters in my
>>> file names but no slashes allowed.
>>>
>>> Example:
>>>
>>>results-Q2/2017.json
>>
>> But how do you distinguish between that file, and a file called
>> 2017.json in a subdirectory called results-Q2?
> 
> When there's a will, there's a way:
> 
>  * Show a folder icon for a directory and a file icon for a file.

I'm blind, and need a text reader. How do I see your folder icon?

Or more importantly, how do I *input* your folder icon?

Or I'm using a text-only interface, because I'm SSH'ed into the computer
over a 2400 baud modem going through a noisy line.


>  * Do it URI style: path/to/results-Q2%2F2017.json

Wait, I see no slash in the file name. How am I supposed to tell my mum to
open the file "results-Q2/2017.json" when it doesn't display the slash? Do
I have to memorise the hex code for / in some obscure system?

How do I distinguish between results-Q2%2F2017.json and results-Q2/2017.json
if the later displays like the former?


>  * Do it C style: path/to/results-Q2\/2017.json

That can't be right. The file name is supposed to be results-Q2/2017.json,
not results-Q2V2017.json.

You're deliberately trying to make things hard for my dear ole mum, aren't
you? You know she doesn't wear her glasses when reading file names.


>  * Do it Python style: [ "path", "to", "results-Q2/2017.json" ]

You got the path wrong. The directory portion is a single directory called
literally:

["path", "to",

(ending with a space, and don't ask me who named this directory, but they
are legal characters so you have to expect them to be used...) and the
filename portion is actually 

"results-Q2/2017.json" ]

so you actually have to write:

['["path", "to", ', '"results-Q2/2017.json" ]']

My dear ole mum just had a stroke trying to understand that, I hope you're
happy now. You brute.


>  * Do it Lisp style: (path to results-Q2/2017.json)
> 
> I'm sure you can come up with several other workable solutions.

You left the prefix "un" out of that adjective.

But all joking aside, of course you can create a complex, fragile, hard to
use system for escaping the record separator character in file names. Do
you imagine that you're the first person who thought of that?

But what does it buy you? *One more character*.

Or, for Windows, I suppose a dozen or so more characters:

https://support.office.com/en-us/article/Invalid-characters-in-file-or-folder-names-or-invalid-file-types-in-OneDrive-for-Business-64883A5D-228E-48F5-B3D2-EB39E07630FA

Either way, you're creating a world of pain for your users, for buggar all
extra benefit.

But if I could borrow Guido's time machine, I'd go back and convince the
file system people to use ^ as the record separator, rather than slash or
backslash or colon. Caret is *much* less likely to be useful in file names
than forward slash (often used for dates) or colon, or even backslash.

^home^steve^document.txt


I'm sure I'd get used to it in a few years... 

Next: convince keyboard manufacturers to move the caret from SHIFT-6 to a
plain, unshifted key. Buggared if I'm going to hit shift every time I want
to use an absolute path...



-- 
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


[issue28157] Document time module constants (timezone, tzname, etc.) as deprecated.

2017-04-01 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
keywords:  -3.2regression

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28157] Document time module constants (timezone, tzname, etc.) as deprecated.

2017-04-01 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

> The datetime module ..

Yes, the datetime module documentation can be improved, but let's keep this 
issue focused on the time module.  Please open a new issue for the datetime 
module improvements.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28157] Document time module constants (timezone, tzname, etc.) as deprecated.

2017-04-01 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Cheryl,

There is no need to apologize. I assigned this issue to myself when I created 
it because I had a few ideas about refactoring the time module documentation 
and thought I would get to it soon.  As often happens other priorities 
interfered.

Contributions are welcome regardless of the "Assigned To" status on the issue.  
In fact, assigned issues may get a quicker response from the assignee than 
unassigned ones.

When looking for simple issues to work on, look for an "easy" keyword.  I did 
not mark this issue as "easy" because I planned to rearrange the module 
documentation in addition to adding a deprecation note.

--
keywords: +3.2regression

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Alain Ketterlin
Marko Rauhamaa  writes:

> It would be nice to be able to use a / in my file names. Funny enough,
> I'm allowed to use a zillion unprintable characters in my file names but
> no slashes allowed.
>
> Example:
>
>results-Q2/2017.json

Use U+2215 (DIVISION SLASH).

I have tried this once. "Next time you're fired/dead" (and less pleasant
variants) was the only comment I got from people I shared files with.

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


Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread eryk sun
On Sat, Apr 1, 2017 at 4:55 PM, Chris Angelico  wrote:
> On Sun, Apr 2, 2017 at 2:43 AM, Marko Rauhamaa  wrote:
>> Steve D'Aprano :
>>
>>> Open your eyes, there is a whole world past the borders of your insular,
>>> close-minded little country. 95% of the world is not American, and there
>>> are millions of Americans who want to use non-ASCII characters in their
>>> file names, even non-Latin characters.
>>
>> It would be nice to be able to use a / in my file names. Funny enough,
>> I'm allowed to use a zillion unprintable characters in my file names but
>> no slashes allowed.
>>
>> Example:
>>
>>results-Q2/2017.json
>
> But how do you distinguish between that file, and a file called
> 2017.json in a subdirectory called results-Q2?

You could use a PUA code or the replacement character (U+FFFD) as an
escape code. I don't think this is possible in Linux or Unix in
general because I think POSIX mandates that '/' is reserved. It *may*
be possible in Windows if you're creating a custom file system and can
get away with requiring users to use \\?\ paths in this case. The
system parses the path up to the volume device, so that part cannot
use backslash. Beyond that, path parsing is up to file-system device
that manages the volume. If the volume is mounted in the object
namespace, then the whole path, including the device name, can use
forward slash, since that's just a normal name character to the object
manager. For example, you can create a device named "My/Device".
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Marko Rauhamaa
Chris Angelico :

> On Sun, Apr 2, 2017 at 2:43 AM, Marko Rauhamaa  wrote:
>> It would be nice to be able to use a / in my file names. Funny
>> enough, I'm allowed to use a zillion unprintable characters in my
>> file names but no slashes allowed.
>>
>> Example:
>>
>>results-Q2/2017.json
>
> But how do you distinguish between that file, and a file called
> 2017.json in a subdirectory called results-Q2?

When there's a will, there's a way:

 * Show a folder icon for a directory and a file icon for a file.

 * Do it URI style: path/to/results-Q2%2F2017.json

 * Do it C style: path/to/results-Q2\/2017.json

 * Do it Python style: [ "path", "to", "results-Q2/2017.json" ]

 * Do it Lisp style: (path to results-Q2/2017.json)

I'm sure you can come up with several other workable solutions.


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


Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Steve D'Aprano
On Sun, 2 Apr 2017 02:43 am, Marko Rauhamaa wrote:

> Steve D'Aprano :
> 
>> Open your eyes, there is a whole world past the borders of your insular,
>> close-minded little country. 95% of the world is not American, and there
>> are millions of Americans who want to use non-ASCII characters in their
>> file names, even non-Latin characters.
> 
> It would be nice to be able to use a / in my file names. 

Yes it would. Obviously the solution is to use colons as the path separator,
like in Classic Mac OS (and a few others).

And then, as sure as water is wet, you'll complain that you want to use : in
your file names.

*Whatever* record separator you choose to use, whether it is slash / or
backslash \ or colon : or Ctrl-^ RS or U+113A HANGUL CHOSEONG SIOS-PHIEUPH,
you can't *also* use it as a non-record separator.

I suppose one might invent an escaping scheme, so that you can escape the
record separator, and another escaping scheme so you can escape the escape
and prevent it from escaping the record separator. That would work.

But it's complex and error prone and people will get it wrong, and the
people who designed the Unix file system didn't think the extra complexity
was worth the benefit. If you disagree, feel free to design your own file
system, and if people prefer yours, they'll use it.

Its not just Unix. As far as I know, *no* file system, from any operating
system, has bothered to introduce an escape character so that file names
can include the path record separator. Not Unix, not Windows, not OS X, not
classic Mac OS, not Solaris.



-- 
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: Moderator please remove [Re: Better way to do this dict comprehesion]

2017-04-01 Thread Skip Montanaro
Passed along to postmas...@python.org, who generally takes care of this
sort of thing.

Skip

On Apr 1, 2017 11:19 AM, "Steve D'Aprano" 
wrote:

> Can one of the mailing list moderators please remove this person's post for
> including a link to an anti-Semitic video by David Duke?
>
>
>
> On Sat, 1 Apr 2017 07:13 pm, Robert L. wrote:
>
> Goyim were born [...]
> web.archive.org/web/20101020044210/http://www.jpost.com/JewishWorld[...]
> archive.org/download/DavidDuke_videos/[...]
>
> I've left in just enough of the original content so the moderator can see
> what I'm objecting to.
>
> Robert, if you're reading this, take your anti-semitism elsewhere, we're
> not
> interested. If you want to discuss Python, you are welcome here, but if you
> use it as a platform for bigotry, you aren't.
>
>
>
> --
> 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
>
-- 
https://mail.python.org/mailman/listinfo/python-list


django add images to models.py from views.py

2017-04-01 Thread Xristos Xristoou
I create a simple Django authentication app and work fine. now I want to add a 
python script where to can do some simple image processing. my python script 
for processing work fine and I put in the views.py. my question is the new 
image created from the script how to can add back to image from mymodel ?first 
must be save temporarily ? can I do this ? sorry I am new.
class MyModel(models.Model):
user = models.ForeignKey(to=settings.AUTH_USER_MODEL)
image = models.ImageField(upload_to=generate_path(self.user))
forms.py
@login_required
class CronForm(forms.Form):
days = forms.ModelChoiceField(queryset=MyModel.objects.all)
views.py
@login_required
def show_something(request,user_id):
   user = UserProfile.objects.get(user__id=user_id)
   form = CronForm()
   if request.method == "POST":
  form = CronForm(request.POST)
  if form.is_valid:
 #  do image processing
 #  do image processing
 # and finaly ta ke new image from the image processing like 
newim='newim.tif'
  return HttpResponseRedirect(...) 
  errors = form.errors or None
   return render(request, 'path/to/template.html',{
  'form': form,
  'errors': errors,
   })
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Chris Angelico
On Sun, Apr 2, 2017 at 2:43 AM, Marko Rauhamaa  wrote:
> Steve D'Aprano :
>
>> Open your eyes, there is a whole world past the borders of your insular,
>> close-minded little country. 95% of the world is not American, and there
>> are millions of Americans who want to use non-ASCII characters in their
>> file names, even non-Latin characters.
>
> It would be nice to be able to use a / in my file names. Funny enough,
> I'm allowed to use a zillion unprintable characters in my file names but
> no slashes allowed.
>
> Example:
>
>results-Q2/2017.json

But how do you distinguish between that file, and a file called
2017.json in a subdirectory called results-Q2?

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


Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Marko Rauhamaa
Steve D'Aprano :

> Open your eyes, there is a whole world past the borders of your insular,
> close-minded little country. 95% of the world is not American, and there
> are millions of Americans who want to use non-ASCII characters in their
> file names, even non-Latin characters.

It would be nice to be able to use a / in my file names. Funny enough,
I'm allowed to use a zillion unprintable characters in my file names but
no slashes allowed.

Example:

   results-Q2/2017.json


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


[issue29957] unnecessary LBYL for key contained in defaultdict, lib2to3/btm_matcher

2017-04-01 Thread Michael Selik

Michael Selik added the comment:

Ok, I'll change the PR.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29961] More compact sets and frozensets created from sets

2017-04-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There is a program that uses 32 GB for sets. The patch could save up to 6 GB 
for it.

I understood your arguments when you lowered the maximal fill ration from 2/3 
to 60%. But in that case the fill ratio is between 15% and 30%! Isn't it too 
small?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-01 Thread Dominic Mayers

Dominic Mayers added the comment:

To sum up, David clarified that we can in fact easily pass an arbitrary factory 
method that creates and starts a request handler, instead of a request handler 
class with setup, handle and finish in its API. This could indeed be a valid 
reason to consider this issue resolved,  but I would like to be sure that it is 
really a normal and supported use of the code. The only place where I can ask 
this is here. If I ask in StackOverflow, etc. I would get all kind of opinions  
and it would not be useful.  To be honest, looking at the parameter name, the 
documentation,  the examples, etc. it does not look at all a normal and 
supported use of the code, but who am I to decide that?  If it turns out to be 
a normal and supported use of the code, then I will create a different issue 
only about the documentation, because it's not clear at all.

--
nosy: +martin.panter

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Moderator please remove [Re: Better way to do this dict comprehesion]

2017-04-01 Thread Steve D'Aprano
Can one of the mailing list moderators please remove this person's post for
including a link to an anti-Semitic video by David Duke?



On Sat, 1 Apr 2017 07:13 pm, Robert L. wrote:

Goyim were born [...]
web.archive.org/web/20101020044210/http://www.jpost.com/JewishWorld[...]
archive.org/download/DavidDuke_videos/[...]

I've left in just enough of the original content so the moderator can see
what I'm objecting to.

Robert, if you're reading this, take your anti-semitism elsewhere, we're not
interested. If you want to discuss Python, you are welcome here, but if you
use it as a platform for bigotry, you aren't.



-- 
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


[issue29897] itertools.chain behaves strangly when copied with copy.copy

2017-04-01 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Serhiy, feel free to take this in whatever direction you think is best.

--
assignee:  -> serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23033] Disallow support for a*.example.net, *a.example.net, and a*b.example.net in certificate wildcard handling.

2017-04-01 Thread Raymond Hettinger

Raymond Hettinger added the comment:

+1

--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Steve D'Aprano
On Sat, 1 Apr 2017 12:17 pm, Rick Johnson wrote:

> Most people just quietly change the filename and move on


There are over a billion people in China, almost a billion more in India,
about 140 million people in Russia, nearly 130 million people in Japan, 250
million in Indonesia, about 290 million native Arabic speakers, and even 9
million speakers of Hebrew.

If you think that all these people, and hundreds of millions more, will
just "quietly change the filename" to ASCII because you're too lazy,
self-centred and arrogant to move on from 1963, then you truly are an
example of the Ugly American.

To say nothing of the hundreds of millions who use Latin character sets that
ASCII cannot handle, including around 65 million British.

Open your eyes, there is a whole world past the borders of your insular,
close-minded little country. 95% of the world is not American, and there
are millions of Americans who want to use non-ASCII characters in their
file names, even non-Latin characters.

You talk about a fraction of that 5%, the tiny minority who care only about
ASCII, and describe them as "most people". That demonstrates the smallness
of your world-view and the enormity of your ignorance. Wake up. The world
is not Smallville USA, it never has been, and never will be.

Either adapt, or get out of the way of those who have.



-- 
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


[issue29957] unnecessary LBYL for key contained in defaultdict, lib2to3/btm_matcher

2017-04-01 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Rather than removing the defaultdict, I think a cleaner fix is to just remove 
the unnecessary LBYL.   That leaves the code a little more compact, faster, and 
nice looking.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29961] More compact sets and frozensets created from sets

2017-04-01 Thread Raymond Hettinger

Raymond Hettinger added the comment:

FWIW, I've long considered this to be a feature of set and dicts, it is the 
only way a user can affect sparseness.  For lookup only sets, the extra 
sparseness is a virtue (fewer collisions).  So, I would like to leave the 
current code in-place.  

With sets the goals are different from dicts.  I place less value on 
compactness and more value on fast membership testing.  And with dicts, the 
norm is that the looked-up key usually exists.  With sets, the goal isn't 
looking an element known to be in the set, but more about determining whether 
an element is in the set.  Accordingly, sets have to optimize for misses as 
well as hits.

In the future, please assign set feature requests to me so that I don't miss 
them.

--
assignee:  -> rhettinger
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29960] _random.Random state corrupted on exception

2017-04-01 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29962] Add math.remainder operation

2017-04-01 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> I'd prefer to keep the name that's consistent with both C and IEEE 754.

+1  

Also, the decimal module names are a poor guide.  Its usability has been 
impaired by opaque naming (i.e. needing to use quantize() when you want to 
round to a fixed number of places).

--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29962] Add math.remainder operation

2017-04-01 Thread Mark Dickinson

Mark Dickinson added the comment:

FTR, I don't have strong opinions on the name: I could be persuaded by any of 
`remainder`, `remainder_near` or `ieee_remainder`. I find `ieee_remainder` 
somewhat more informative than `remainder_near`.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29962] Add math.remainder operation

2017-04-01 Thread Mark Dickinson

Mark Dickinson added the comment:

> In many cases the function that returns the nearest integer quotient is 
> useful.

Agreed, but I'd like to keep the scope of this issue small for now: we're 
simply wrapping / implementing another C99 math.h function.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29962] Add math.remainder operation

2017-04-01 Thread Mark Dickinson

Mark Dickinson added the comment:

> Shouldn't the new function be named math.remainder_near?

Not clear. :-) I'd prefer to keep the name that's consistent with both C and 
IEEE 754. (We already have plenty of naming differences between Decimal and 
math; attempting to reconcile them is likely futile.)

FTR:

IEEE 754: remainder
C99: remainder
IBM Decimal spec: remainder-near
Java: IEEEremainder
.NET: IEEERemainder

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29962] Add math.remainder operation

2017-04-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also Decimal.remainder_near and _PyLong_DivmodNear. Shouldn't the new 
function be named math.remainder_near?

In many cases the function that returns the nearest integer quotient is useful. 
See Fraction.__round__, datetime._divide_and_round, _pydecimal._div_nearest, 
etc.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29956] math.exp documentation is misleading

2017-04-01 Thread Mark Dickinson

Mark Dickinson added the comment:

PR made. New wording is:

"""
Return e raised to the power *x*, where e = 2.718281... is the base of natural 
logarithms.
"""

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29956] math.exp documentation is misleading

2017-04-01 Thread Mark Dickinson

Changes by Mark Dickinson :


--
pull_requests: +1133

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29962] Add math.remainder operation

2017-04-01 Thread Mark Dickinson

Changes by Mark Dickinson :


--
pull_requests: +1132

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >