Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Rustom Mody
On Sunday, October 9, 2016 at 1:18:32 PM UTC+5:30, Gregory Ewing wrote:
> Here's the first part of the essay I said I'd write about
> monads:
> 
> http://www.cosc.canterbury.ac.nz/greg.ewing/essays/monads/DemystifyingMonads.html
> 
> Hope it's useful,
> Greg

Thanks Greg... looks v useful... the continuation-oriented approach.
Will say more after a more careful study
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-09 Thread meInvent bbird
https://social.msdn.microsoft.com/Forums/vstudio/en-US/5f0a9a51-a256-4671-a5fc-e213949e7204/how-to-refactor-3-nested-for-loop-into-smaller-for-loop-assume-each-of-them-independent?forum=csharpgeneral
 

since when i dsolve a differential ideal used near 5GB memory for one ideal
, i feel that i need to use amazon instance, 
i do not know whether sympy use same amount of memory

i prepared to split a for loop which for combination if use i < j and j < k
so 84 Billion /2 = 42 Billions combinations

each script for doing 100 combinations range, it generate around 4XX files

if read the final file it generated,
is

for ii from 1925 to 2025 do
 for jj from 2040 to 2040 do
  for kk from 2040 to 2040 do

it seems missed 2026 to 2040 this range in the final file
i feel that my crafted algorithm is not full combinations

I wrote a algorithm to split for loop to generate maplesoft code for limited 
memory 

Assume I convert this algorithm into Python script and use sympy to do dsolve 

How to distribute to hundreds of Amazon instance to run each smaller for loop 



i am not familiar with using Amazon, 
such as how to create hundreds of EC2 instances

i guess use python script to ssh all remote instance
run a python script with bash command which in python script



On Monday, October 10, 2016 at 6:49:12 AM UTC+8, Chris Angelico wrote:
> On Mon, Oct 10, 2016 at 9:40 AM, Marko Rauhamaa  wrote:
> > Chris Angelico :
> >> Yeah, if it's just for progress status. Of course, that does assume
> >> that the run() function doesn't have anything particularly costly in
> >> it. If it does, well, dis gonna take a while
> >
> > Dealing with multigigabyte data streams is not over the top nowadays.
> 
> This is true, but ultimately, it all comes down to the run() function.
> With no further posts since the drive-by at the beginning, we have
> nothing solid to discuss this on.
> 
> ChrisA

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


Solid Approach For Creating A Desktop Application

2016-10-09 Thread Mahan Marwat
I want to know what will be your approach creating a solid/reliable application 
in Python?
i.e
1. Which GUI framework will you use i.e PyQT or what? (will you make it work 
removing the window default border)
2. What will you use for it's style/appearance i.e CSS or what?
3. Which tool will you use to make an executable of your application i.e Py2exe 
or what?
4. Which tool will you use to make an installable of your application i.e Nsis 
or what?
My approach: Python --> PyGTK --> Cx_Freeze --> Nsis
And last and important question, does your application will work smoothly and 
will not crash?
If I am missing something like testing your application etc... Please mention 
those things too.
I want to know a full method of creating a solid desktop application.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue28403] Migration RFE: optional warning for implicit unicode conversions

2016-10-09 Thread Nick Coghlan

Nick Coghlan added the comment:

(Correction to the above: the case where this came up turned out to be due to 
consuming code monkeypatching things when it really shouldn't have been, so it 
fell into the second category of "It would have been helpful to be able to more 
easily rule this out as a contributing factor")

--

___
Python tracker 

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



[issue28403] Migration RFE: optional warning for implicit unicode conversions

2016-10-09 Thread Nick Coghlan

New submission from Nick Coghlan:

Some of the hardest compatibility issues to track down in Python 3 migrations 
are those where existing code is depending on an implicit str->unicode 
promotion something in the depths of a support library (or sometimes even the 
standard library - the context where this came up relates to some apparent 
misbehaviour in the standard library). In other cases, just being able to rule 
implicit conversions out as a possible contributing factor can be helpful in 
finding the real problem.

It's technically already possible to hook implicit conversions by adjusting (or 
shadowing) the site.py module and replacing the default "ascii" encoding with 
one that emits a warning whenever you rely on it: 
http://washort.twistedmatrix.com/2010/11/unicode-in-python-and-how-to-prevent-it.html

However, actually setting that up is a bit tricky, since we deliberately drop 
"sys.setdefaultencoding" from the sys module in the default site module. That 
means requesting warnings for implicit conversions requires doing the following:

1. Finding the "ascii_with_warnings" codec above (or writing your own)
2. Learning one of the following 3 tricks for overriding the default encoding:

2a. Run with "-S" and call sys.setdefaultencoding post-startup
2b. Edit the actual system site.py in a container or other test environment
2c. Shadow site.py with your own modified copy

3. Run your tests or application with the modified default encoding

If we wanted to make that easier for folks migrating, the first step would be 
to provide the "ascii_with_warnings" codec by default in Python 2.7 (perhaps as 
"_ascii_with_warnings", since it isn't intended for general use, it's just a 
migration helper)

The second would be to provide a way to turn it on that doesn't require 
fiddling with the site module. The simplest option there would be to always 
enable it under `-3`.

The argument against the simple option is that I'm not sure how noisy it would 
be by default - there are some standard library modules (e.g. URL processing) 
where we still rely on implicit encoding and decoding in Python 2, but have 
separate code paths in Python 3.

Since we don't have -X options in Python 2, the second simplest alternative 
would be to leave `sys.setdefaultencoding` available when running under `-3`: 
that way folks could more easily opt in to enabling the "ascii_with_warnings" 
codec selectively (e.g. via a context manager), rather than always having it 
enabled.

--
messages: 278402
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: Migration RFE: optional warning for implicit unicode conversions
type: enhancement
versions: Python 2.7

___
Python tracker 

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



[issue28402] Add signed catalog files for stdlib on Windows

2016-10-09 Thread Steve Dower

Changes by Steve Dower :


--
resolution:  -> fixed
stage:  -> 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



[issue28402] Add signed catalog files for stdlib on Windows

2016-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e050ed5da06d by Steve Dower in branch '3.6':
Issue #28402: Adds signed catalog files for stdlib on Windows.
https://hg.python.org/cpython/rev/e050ed5da06d

New changeset 27edae50e62c by Steve Dower in branch 'default':
Issue #28402: Adds signed catalog files for stdlib on Windows.
https://hg.python.org/cpython/rev/27edae50e62c

--
nosy: +python-dev

___
Python tracker 

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



[issue28402] Add signed catalog files for stdlib on Windows

2016-10-09 Thread Steve Dower

New submission from Steve Dower:

On Windows, we sign all binaries with the PSF code signing certificate.

We can also sign all the standard library and tools .py files using a catalog, 
which will put the hashes of the original files into a signed bundle. This can 
then be validated by users (e.g. using "signtool.exe verify") at any point 
after installation. Worth noting that the OS does not automatically verify 
signatures in a catalog file.

It's only worthwhile doing this for files that may end up on a production 
machine - essentially, those files included in lib.msi and tools.msi (not 
test.msi, dev.msi or tcltk.msi).

--
assignee: steve.dower
components: Windows
messages: 278400
nosy: paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Add signed catalog files for stdlib on Windows
type: enhancement
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue28394] Spelling fixes

2016-10-09 Thread Martin Panter

Martin Panter added the comment:

Thanks Ville. I added some more fixes of my own I had been saving up.

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 2.7, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue28398] Return singleton empty string in _PyUnicode_FromASCII

2016-10-09 Thread Xiang Zhang

Xiang Zhang added the comment:

The cost is really small (an integer compare vs memory malloc and copy). The 
advantages are fast path for empty strings and retaining consistency with other 
codes in unicodeobject.c. You can see other places use the same optimization, 
e.g. PyUnicode_FromUnicode, PyUnicode_FromUCS1, and some functions using 
unicode_result.

--

___
Python tracker 

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



[issue28397] Faster index range checks

2016-10-09 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Don't change the code in the collections module.  While semantically valid, the 
change obfuscates the code.  The meaning of maxlen < 0 is that there is no 
maximum length.  I don't want this test hidden; otherwise, I would have changed 
it long ago as was done elsewhere in the module where it made sense.

Elsewhere, consider making a macro with clear name and comment (as was done 
with NEEDS_TRIM) in the collections module.  Otherwise, you're just leaving 
behind constipated and tricky code with no indication of why a signed variable 
is being coerced to unsigned.

--
nosy: +rhettinger

___
Python tracker 

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



Re: Function to take the minimum of 3 numbers

2016-10-09 Thread Chris Angelico
On Mon, Oct 10, 2016 at 11:38 AM, Matt Wheeler  wrote:
> On Mon, 10 Oct 2016, 00:56 Ian Kelly,  wrote:
>
>> On Oct 9, 2016 2:57 PM,  wrote:
>> The Pythonic way
>>
>> if b >= a <= c:
>> ...
>>
>>
>> Better:
>>
>> if a <= b <= c:
>> ...
>>
>
> That's not equivalent. Consider `a, b, c = 1, 7, 4`
>
>
>> Using consistent operators is not required but is easier to read and less
>> confusing.
>>
>
> Unfortunately in this case it's also less correct

Proof that it's confusing: Someone tried to tidy up the code, and
unwittingly changed its semantics.

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


[issue28394] Spelling fixes

2016-10-09 Thread Roundup Robot

New submission from Roundup Robot:

New changeset 6b1df8905012 by Martin Panter in branch '3.5':
Issue #28394: Spelling and typo fixes in code comments and changelog
https://hg.python.org/cpython/rev/6b1df8905012

New changeset bd113af10005 by Martin Panter in branch '3.6':
Issue #28394: Merge typo fixes from 3.5 into 3.6
https://hg.python.org/cpython/rev/bd113af10005

New changeset 004d1809db41 by Martin Panter in branch '3.6':
Issue #28394: More typo fixes for 3.6+
https://hg.python.org/cpython/rev/004d1809db41

New changeset 678fe178da0d by Martin Panter in branch 'default':
Issue #28394: Merge typo fixes from 3.6
https://hg.python.org/cpython/rev/678fe178da0d

New changeset de13f5a0f4d5 by Martin Panter in branch '2.7':
Issue #28394: Typo fixes in code comments and changelog
https://hg.python.org/cpython/rev/de13f5a0f4d5

--
nosy: +python-dev

___
Python tracker 

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



Re: Function to take the minimum of 3 numbers

2016-10-09 Thread Matt Wheeler
On Mon, 10 Oct 2016, 00:56 Ian Kelly,  wrote:

> On Oct 9, 2016 2:57 PM,  wrote:
> The Pythonic way
>
> if b >= a <= c:
> ...
>
>
> Better:
>
> if a <= b <= c:
> ...
>

That's not equivalent. Consider `a, b, c = 1, 7, 4`


> Using consistent operators is not required but is easier to read and less
> confusing.
>

Unfortunately in this case it's also less correct

> --

--
Matt Wheeler
http://funkyh.at
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Paul Rubin
> Well, at least I refrained from saying that monads are like burritos!

But they are!  See: http://blog.plover.com/prog/burritos.html
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Signals and Threads in Python 3.5 or so

2016-10-09 Thread Paul Rubin
Dan Stromberg  writes:
> That bug is: if you control-C the top-level process, all the
> subprocesses are left running.

Are you setting the daemon flag?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Signals and Threads in Python 3.5 or so

2016-10-09 Thread Chris Angelico
On Mon, Oct 10, 2016 at 10:52 AM, Dan Stromberg  wrote:
> That bug is: if you control-C the top-level process, all the
> subprocesses are left running.
>
> I've been thinking about making it catch SIGINT, SIGTERM and SIGHUP,
> and having it SIGKILL its active subprocesses upon receiving one of
> these signals.
>
> However, it's multithreaded, and I've heard that in CPython, threads
> and signals don't mix well.

Generally, expect SIGINT  to be handled by the main thread, and code
accordingly. But I've never used the low-level thread and _thread
modules, so I'd be inclined to follow through with the TODO and make
it use threading instead.

This simple example appears to work fine on my system (Debian Stretch,
Linux 4.6, amd64), but I can't make any hard-and-fast guarantees.

import threading
import signal
import random
import time

halt = False

def thread():
global halt
try:
print(threading.current_thread(), "-- start")
for i in range(random.randrange(10, 20)):
time.sleep(1)
if halt: break
print(threading.current_thread(), "--", i)
except KeyboardInterrupt:
print(threading.current_thread(), "-- SIGINT")
halt = True
print(threading.current_thread(), "-- end")

for i in range(5):
threading.Thread(target=thread).start()
thread()


Hit Ctrl-C and all threads will quickly terminate.

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


[issue24459] Mention PYTHONFAULTHANDLER in the man page

2016-10-09 Thread Joshua Jay Herman

Joshua Jay Herman added the comment:

Hi I performed the rebase on the default branch.

--
Added file: 
http://bugs.python.org/file45041/rebased_addMissingEnvironmentalVariables.patch

___
Python tracker 

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



Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Ben Finney
Gregory Ewing  writes:

> Here's the first part of the essay I said I'd write about
> monads:

Thank you for tackling this.

> http://www.cosc.canterbury.ac.nz/greg.ewing/essays/monads/DemystifyingMonads.html

You appreciate an important feature of this:

Often it is presented in a very abstract and mathematical way, which
tends to have an eye-glazing effect on people who aren't hard-core
mathematicians. This is an attempt to convey the basic ideas behind
monads to someone who is a programmer rather than a mathematician.

One important lack that I often see in essays written by mathematicians
about programming, is the tendency to use opaque single-character
symbols., such as might be easy to write in chalk on a blackboard.

In a programming language, though, we do not have the constraint of
writing them with chalk on a blackboard. Symbols can be given
*descriptive names*, that communicate the semantic meaning of the
symbol.

Can you re-write the code examples, for example::

def add(x, f, s):
  s.add(x)
  return f(s)

so that they are PEP 8 conformant? That means (in addition to 4-column
indentation at each level) that you should *choose descriptive
names* and use them consistently, to help the reader understand the
code.

-- 
 \“Telling pious lies to trusting children is a form of abuse, |
  `\plain and simple.” —Daniel Dennett, 2010-01-12 |
_o__)  |
Ben Finney

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


Re: Function to take the minimum of 3 numbers

2016-10-09 Thread Ian Kelly
On Oct 9, 2016 2:57 PM,  wrote:

On Sunday, October 9, 2016 at 2:41:41 PM UTC+1, BartC wrote:
> def min3(a,b,c):
>  if a<=b and a<=c:
>  return a
>  elif b<=a and b<=c:
>  return b
>  else:
>  return c

The Pythonic way

if b >= a <= c:
...


Better:

if a <= b <= c:
...

Using consistent operators is not required but is easier to read and less
confusing.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue28373] input() prints to original stdout even if sys.stdout is wrapped

2016-10-09 Thread Martin Panter

Martin Panter added the comment:

>From memory, there are at least three code paths for input():

1. Fallback implementation, used when stdout is a pipe or other non-terminal
2. Default PyOS_ReadlineFunctionPointer() hook, used when stdout is a terminal: 
https://docs.python.org/3.5/c-api/veryhigh.html#c.PyOS_ReadlineFunctionPointer
3. Gnu Readline (or another hook installed by a C module)

Arnon’s problem only seems to occur in the last two cases, when 
PyOS_ReadlineFunctionPointer() is used. The problem is that 
PyOS_ReadlineFunctionPointer() uses C  FILE pointers, not Python file 
objects. Python calls sys.stdout.fileno() to see if it can substitute the 
C-level stdout FILE object.

Adam: I think your sys.readlinehook() proposal is independent of Arnon’s 
problem. We would still need some logic to decide what to pass to libraries 
like Gnu Readline that want a FILE pointer instead of a Python file object.

The fileno() method is documented all file objects, including text files like 
sys.stdout. So I think implementing your own fileno() method is completely 
valid.

One other idea that comes to mind is if Python checked if the sys.stdout object 
has been changed (e.g. sys.stdout != sys.__stdout__), rather than just 
comparing fileno() values. But I am not sure if this change is worth it.

BTW if I revert the fix for Issue 24402 (I also tried 3.3.3), the problem 
occurs even when a custom fileno() is defined. On the other hand, Python 2’s 
raw_input() is not affected, presumably because it uses PyFile_AsFile() and 
fails immediately if stdout is a custom class.

--
nosy: +martin.panter

___
Python tracker 

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



Signals and Threads in Python 3.5 or so

2016-10-09 Thread Dan Stromberg
I have a program http://stromberg.dnsalias.org/~dstromberg/looper/
that I use and maintain.

It's like GNU parallel or similar - yet another "run n processes, m at
a time" implementation.  Interestingly, I've only used/tested it on
Linux, but it's under a Microsoft copyright because Microsoft acquired
a Linux company I was working for.

Anyway, it seems to work well, except one annoying bug.

That bug is: if you control-C the top-level process, all the
subprocesses are left running.

I've been thinking about making it catch SIGINT, SIGTERM and SIGHUP,
and having it SIGKILL its active subprocesses upon receiving one of
these signals.

However, it's multithreaded, and I've heard that in CPython, threads
and signals don't mix well.

Is this still an issue in CPython 3.5?  If yes, how can I work around it?

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


Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-09 Thread Chris Angelico
On Mon, Oct 10, 2016 at 9:40 AM, Marko Rauhamaa  wrote:
> Chris Angelico :
>> Yeah, if it's just for progress status. Of course, that does assume
>> that the run() function doesn't have anything particularly costly in
>> it. If it does, well, dis gonna take a while
>
> Dealing with multigigabyte data streams is not over the top nowadays.

This is true, but ultimately, it all comes down to the run() function.
With no further posts since the drive-by at the beginning, we have
nothing solid to discuss this on.

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


Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-09 Thread Marko Rauhamaa
Chris Angelico :
> Yeah, if it's just for progress status. Of course, that does assume
> that the run() function doesn't have anything particularly costly in
> it. If it does, well, dis gonna take a while

Dealing with multigigabyte data streams is not over the top nowadays.


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


Re: How to read maple .m file into Python?

2016-10-09 Thread breamoreboy
On Sunday, October 9, 2016 at 10:00:26 PM UTC+1, Ho Yeung Lee wrote:
> i saved a list of matrix of algebra into .m file in maple
> How to read and import into Python for sympy to use?

I'd start here 
http://www.maplesoft.com/support/help/Maple/view.aspx?path=UserManual/Chapter11 
which was the first hit I got on google for "read .m maple file with python".

Kindest regards.

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


Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-09 Thread Chris Angelico
On Mon, Oct 10, 2016 at 4:57 AM, BartC  wrote:
> On 09/10/2016 18:33, Jussi Piitulainen wrote:
>>
>> Chris Angelico writes:
>>
>>> On Mon, Oct 10, 2016 at 12:26 AM, Dennis Lee Bieber wrote:

 {This response is delayed as I'm waiting for the program to complete so
 I
 can get the run time}
 {Well... it's been near 24 hours and still merrily scrolling sums on my
 console -- so I'm going to kill the running program}
>>>
>>>
>>> Eight BILLION of them. I wouldn't bother waiting for that.
>>
>>
>> Eight billion is a big number. I know from experience that computers can
>> compute a big number of computations in a short time. Therefore, I would
>> expect the computer to compute eight billion computations in a short
>> time. Maybe.
>
>
> Compute, maybe. But the OP is printing something out at each step. Printing
> to a console is very, very slow, compared with even with running CPython.
>
> On my machine, CPython might run through an empty loop at 10 to 20M
> iterations per second, but is some 4000 times slower if it has to print one
> "A" per line at each step.

Yeah. Quickest way to slow down a calculation is to naively add a
progress indicator to it.

(Actually, that's not quite fair. The quickest way is to add a
time-of-day call every iteration, in a misguided attempt to reduce
console output to "one every 0.1 seconds". That's crazy slow.)

> The OP might try redirecting the output to a file (assuming he doesn't want
> to read every single line of output as it's produced). That will be much
> faster, although it depends on the workload in the run() function being
> executed.
>
> Or only print every 1000th line or something if progress has to be
> monitored.

Yeah, if it's just for progress status. Of course, that does assume
that the run() function doesn't have anything particularly costly in
it. If it does, well, dis gonna take a while

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


[issue28343] Bad encoding alias cp936 -> gbk: euro sign

2016-10-09 Thread Mingye Wang

Mingye Wang added the comment:

The "join the web people" solution should look like this:

$ diff -Naurp a/_codecs_cn.c b/_codecs_cn.c
--- a/_codecs_cn.c2016-10-09 14:24:04.675111500 -0700
+++ b/_codecs_cn.c2016-10-09 14:27:06.600961500 -0700
@@ -128,6 +128,12 @@ ENCODER(gbk)
 continue;
 }

+if (c == 0x20AC) { /* cp936, or web GBK */
+WRITEBYTE1((unsigned char)0x80);
+NEXT(1, 1);
+continue;
+}
+
 if (c > 0x)
 return 1;

@@ -159,6 +165,12 @@ DECODER(gbk)
 NEXT_IN(1);
 continue;
 }
+
+if (c == 0x80) { /* cp936, or web GBK */
+OUTCHAR(0x20AC);
+NEXT_IN(1);
+continue;
+}

 REQUIRE_INBUF(2);

It should be mostly safe as this character is not previously defined in 
Python's GBK implementation.

--

___
Python tracker 

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



[issue28092] Build failure for 3.6 on Centos 5.11

2016-10-09 Thread Martin Panter

Martin Panter added the comment:

For replacing macros, I think “static inline” may be fine, even with older 
compilers. Maybe these PyDTrace_ functions could also be static inline, since 
they were originally macros. Or do they really need to be linkable inline 
functions?

--

___
Python tracker 

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



Re: calculator between raster

2016-10-09 Thread chrischris201444
Τη Κυριακή, 9 Οκτωβρίου 2016 - 11:55:54 μ.μ. UTC+3, ο χρήστης 
chrischr...@gmail.com έγραψε:
> any idea how to calculator rasters images ?like 
> ((raster1+raster2)*(raster4*9)}
> for example.
> maybe is easy that question but i dont work again with raster and python
> i have gdal,numpy,scipy,pygeoprocesing and more

is easy to show me an example?i am very begin
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: calculator between raster

2016-10-09 Thread Christian Gollwitzer

Am 09.10.16 um 22:55 schrieb chrischris201...@gmail.com:

any idea how to calculator rasters images ?like ((raster1+raster2)*(raster4*9)}
for example.
maybe is easy that question but i dont work again with raster and python
i have gdal,numpy,scipy,pygeoprocesing and more
With PIL you can read an image file into numpy array, do your 
calculations the way you wrote, and transform it back to an image (file, 
or display).


Try:

from PIL import Image
import numpy
arr = numpy.asarray(Image.open('somefile.png'))


Christian

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


How to split a large nested for loop and distribute to hundreds of Amazon instance to run this kind of Python code?

2016-10-09 Thread Ho Yeung Lee
https://social.msdn.microsoft.com/Forums/vstudio/en-US/5f0a9a51-a256-4671-a5fc-e213949e7204/how-to-refactor-3-nested-for-loop-into-smaller-for-loop-assume-each-of-them-independent?forum=csharpgeneral

I wrote a algorithm to split for loop to generate maplesoft code for limited 
memory
Assume I convert this algorithm into Python script and use sympy to do dsolve
How to distribute to hundreds of Amazon instance to run each smaller for loop 
-- 
https://mail.python.org/mailman/listinfo/python-list


How to read maple .m file into Python?

2016-10-09 Thread Ho Yeung Lee
i saved a list of matrix of algebra into .m file in maple
How to read and import into Python for sympy to use?
-- 
https://mail.python.org/mailman/listinfo/python-list


calculator between raster

2016-10-09 Thread chrischris201444
any idea how to calculator rasters images ?like ((raster1+raster2)*(raster4*9)}
for example.
maybe is easy that question but i dont work again with raster and python
i have gdal,numpy,scipy,pygeoprocesing and more
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Function to take the minimum of 3 numbers

2016-10-09 Thread Larry Hudson via Python-list

On 10/09/2016 05:01 AM, Cai Gengyang wrote:

def min3(a, b, c):

min3 = a
if b < min3:
min3 = b
if c < min3:
min3 = c
if b < c:
min3 = b
return min3


print(min3(4, 7, 5))

4



This is NOT a recommendation here, just a different way of looking at the problem (and is 
probably cheating anyway)...


def min3(a, b, c):
return sorted([a, b, c])[0]  #  Create a list, sort it and return the 1st 
element

It can be extended to take any number of parameters:

def minn(*args):
return sorted(args)[0]

The * syntax takes all the parameters and puts them into a single tuple.

This is _almost_ the same as the built-in min() function — the built-in requires a single 
(sequence) parameter, my minn() function requires multiple individual parameters.  (Both 
versions fail with zero parameters.)


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


[issue28400] Remove uncessary checks in unicode_char and resize_copy

2016-10-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: commit 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



[issue28400] Remove uncessary checks in unicode_char and resize_copy

2016-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 61e454a1c9d7 by Serhiy Storchaka in branch 'default':
Issue #28400: Removed uncessary checks in unicode_char and resize_copy.
https://hg.python.org/cpython/rev/61e454a1c9d7

--
nosy: +python-dev

___
Python tracker 

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



[issue28400] Remove uncessary checks in unicode_char and resize_copy

2016-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--
assignee:  -> serhiy.storchaka
stage: patch review -> commit review

___
Python tracker 

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



[issue28398] Return singleton empty string in _PyUnicode_FromASCII

2016-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Additional check has a non-zero cost. What is the benefit of this change?

--

___
Python tracker 

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



[issue28183] Clean up and speed up dict iteration

2016-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Few weeks I tried to rewrite loops in more fast way, but I have not found 
anything significantly faster or clearer. Some forms of was a few percent 
faster, but I would be difficult to explain this effect. Most likely it was an 
artifact of the compilation.

Removed unrelated changes from dict_iter8.patch and added additional check in 
_PyDict_Next() before committing.

--
resolution:  -> fixed
stage:  -> 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



[issue28183] Clean up and speed up dict iteration

2016-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 112714f3745d by Serhiy Storchaka in branch '3.6':
Issue #28183: Optimize and cleanup dict iteration.
https://hg.python.org/cpython/rev/112714f3745d

--
nosy: +python-dev

___
Python tracker 

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



Re: Python Data base help

2016-10-09 Thread breamoreboy
On Sunday, October 9, 2016 at 7:56:57 PM UTC+1, Risat Haque wrote:
> Hey, i have a data base filled with numbers from a recent drone flight. IT 
> contains, alt, long, lat, and time.
> In python, i want to ask the user to put in a time : 
> askTime = (input("Choose a time (HourMinSec):"))
> 
> With this, I need it to search through the entire data base to find that 
> number. 
> 
> ("UTC: 8:58:24 lat: 50.97 long: -114.05  Alt: 1047.40m  SOG: 1.04 km/h") 
> 
> EX: 
> 
> Choose a time (HourMinSec):8:58:24
> Data: UTC: 8:58:24 lat: 50.97 long: -114.05  Alt: 1047.40m  SOG: 1.04 km/h"
> 
> How can I do this?

I'd use strptime[1] to check the input then search your database, whatever that 
may be, based on that.

[1] https://docs.python.org/3/library/datetime.html#datetime.datetime.strptime

Kindest regards.

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


Re: Function to take the minimum of 3 numbers

2016-10-09 Thread breamoreboy
On Sunday, October 9, 2016 at 2:41:41 PM UTC+1, BartC wrote:
> On 09/10/2016 13:01, Cai Gengyang wrote:
> > I'm moving on to chapter 9 
> > (http://programarcadegames.com/index.php?lang=en=lab_functions) of 
> > programarcadegames for the time being and going back to chapter 8 later 
> > (its just fucking frustrating and doesn't seem to work for the time being 
> > and I have a very bad temper).
> >
> > At least for chapter 9, I got the first part correct at first try --- 
> > define a function that takes and prints the smallest of 3 numbers. I pasted 
> > it here for reference and discussion. The code can also be further modified 
> > to include a clause that says that if two numbers tie for smallest, choose 
> > any of the two numbers. (I will attempt to do it and then post it here 
> > again for future discussion with users here
> >
> >
>  def min3(a, b, c):
> > min3 = a
> > if b < min3:
> > min3 = b
> > if c < min3:
> > min3 = c
> > if b < c:
> > min3 = b
> > return min3
> >
>  print(min3(4, 7, 5))
> > 4
> >
> 
> The exercise says you must use an if/elif chain. The first thing that 
> comes to mind is:
> 
> def min3(a,b,c):
>  if a<=b and a<=c:
>  return a
>  elif b<=a and b<=c:
>  return b
>  else:
>  return c
> 
> The bit about numbers tying for smallest is not meaningful; the caller 
> can't tell if a minimum value of 42 came from a, b or c.
> 
> -- 
> Bartc

The Pythonic way

if b >= a <= c:
...

Kindest regards.

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


[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-09 Thread Guido van Rossum

Guido van Rossum added the comment:

Hm. I agree that _getframe() is horrible. But I'm not sure I want code outside 
typing.py to be aware of __origin__.

--
priority: release blocker -> deferred blocker

___
Python tracker 

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



[issue12974] array module: deprecate '__int__' conversion support for array elements

2016-10-09 Thread Oren Milman

Changes by Oren Milman :


--
nosy: +Oren Milman

___
Python tracker 

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



Re: Passing Variable to Function

2016-10-09 Thread alister
On Fri, 07 Oct 2016 19:06:54 +, John McKenzie wrote:

> Brendan and Alister, thank you both for responding.
> 
>  I am very inexperienced with python, but not new to computers so on my
> own I realized the strings vs number mistake. (I seem to work with and
> learn about Python for a few weeks at a time with 6 to 12 months in
> between.

I spend most of my time simply lurking here because I am very much an 
amateur (although in the distant pas I was a microcontroler firmware 
programmer in 6800 assembler).
Primarily program in python for personal pleasure.
this ws on occasion where i felt I was able to offer as good an 
explanation as anyone on the list so was glad to give something back


-- 
Why use Windows, since there is a door?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Data base help

2016-10-09 Thread Irmen de Jong
On 9-10-2016 20:56, Risat Haque wrote:
> Hey, i have a data base filled with numbers from a recent drone flight. IT 
> contains, alt, long, lat, and time.
> In python, i want to ask the user to put in a time : 
> askTime = (input("Choose a time (HourMinSec):"))
> 
> With this, I need it to search through the entire data base to find that 
> number. 
> 
> ("UTC: 8:58:24 lat: 50.97 long: -114.05  Alt: 1047.40m  SOG: 1.04 km/h") 
> 
> EX: 
> 
> Choose a time (HourMinSec):8:58:24
> Data: UTC: 8:58:24 lat: 50.97 long: -114.05  Alt: 1047.40m  SOG: 1.04 km/h"
> 
> How can I do this? 
> 

What is your 'database'?
>From the little information you provided it seems that it is just a text file 
>where
every drone measurement is on a line. So simply read every line and check if 
the time
entered is in that line, then print it.


Irmen

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


Re: BeautifulSoup help !!

2016-10-09 Thread alister
On Fri, 07 Oct 2016 03:12:32 +1100, Steve D'Aprano wrote:

> On Fri, 7 Oct 2016 02:30 am, alister wrote:
> 
>> On Thu, 06 Oct 2016 08:22:05 -0700, desolate.soul.me wrote:
>> 
>>> So I've just started up with python and an assignment was given to me
>>> by a company as an recruitment task.
>>>
>> so by your own admission you have just started with python yet you
>> consider your self suitable for employment?
> 
> What's your problem Alister? Do you think that junior devs aren't
> allowed to ask for help?
> 
I read the original post as I have just started learning python & have 
applied for a job as a python programmer (which struck me as being a bit 
ambitious)
you will see that I replied quite promptly & (I think) constructively to 
the OP when he clarified the situation.


-- 
I fill MY industrial waste containers with old copies of the "WATCHTOWER"
and then add HAWAIIAN PUNCH to the top ...  They look NICE in the yard ...
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-09 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

I tried and all tests pass on 3.7a also with prior import of typing.

A larger fix is not _necessary_, but I would _prefer_ to go with the option 4 
that I proposed above, i.e.:

Instead of special casing abc and functools in __subclasshook__ in typing via 
sys._getframe, I would rather add small changes to abc and functools (they 
should use __origin__ in subclass checks).

In general, I think we should document __origin__, it could be useful at 
runtime (especially that we prohibit certain things like class checks for 
parameterized generics).

--

___
Python tracker 

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



Python Data base help

2016-10-09 Thread Risat Haque
Hey, i have a data base filled with numbers from a recent drone flight. IT 
contains, alt, long, lat, and time.
In python, i want to ask the user to put in a time : 
askTime = (input("Choose a time (HourMinSec):"))

With this, I need it to search through the entire data base to find that 
number. 

("UTC: 8:58:24 lat: 50.97 long: -114.05  Alt: 1047.40m  SOG: 1.04 km/h") 

EX: 

Choose a time (HourMinSec):8:58:24
Data: UTC: 8:58:24 lat: 50.97 long: -114.05  Alt: 1047.40m  SOG: 1.04 km/h"

How can I do this? 
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-09 Thread Guido van Rossum

Guido van Rossum added the comment:

So is a larger fix not necessary? If so we can close this (assuming
the tests now pass).

--

___
Python tracker 

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



Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-09 Thread BartC

On 09/10/2016 18:33, Jussi Piitulainen wrote:

Chris Angelico writes:


On Mon, Oct 10, 2016 at 12:26 AM, Dennis Lee Bieber wrote:

{This response is delayed as I'm waiting for the program to complete so I
can get the run time}
{Well... it's been near 24 hours and still merrily scrolling sums on my
console -- so I'm going to kill the running program}


Eight BILLION of them. I wouldn't bother waiting for that.


Eight billion is a big number. I know from experience that computers can
compute a big number of computations in a short time. Therefore, I would
expect the computer to compute eight billion computations in a short
time. Maybe.


Compute, maybe. But the OP is printing something out at each step. 
Printing to a console is very, very slow, compared with even with 
running CPython.


On my machine, CPython might run through an empty loop at 10 to 20M 
iterations per second, but is some 4000 times slower if it has to print 
one "A" per line at each step.


The OP might try redirecting the output to a file (assuming he doesn't 
want to read every single line of output as it's produced). That will be 
much faster, although it depends on the workload in the run() function 
being executed.


Or only print every 1000th line or something if progress has to be 
monitored.


--
Bartc

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


[issue3401] wsgiref can't handle unicode environments

2016-10-09 Thread R. David Murray

R. David Murray added the comment:

Since this is a buildbot error report and we don't release unless the buildbots 
in the stable set are green, I think we can close this now :)

--
nosy: +r.david.murray
resolution:  -> out of date
stage: test needed -> 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



[issue28389] xmlrpc.client HTTP proxy example code does not work

2016-10-09 Thread Attila Vangel

Attila Vangel added the comment:

Thanks for fixing this issue. I checked the changed documentation online, and I 
came up with a very similar solution. One difference is that although this 
example overrides the make_connection() method, but omits the following lines 
which are present in the xmlrpc.client.Transport code (I checked that in python 
3.5.3):

# return an existing connection if possible.  This allows
# HTTP/1.1 keep-alive.
if self._connection and host == self._connection[0]:
return self._connection[1]
# create a HTTP connection object from a host descriptor
chost, self._extra_headers, x509 = self.get_host_info(host)

Please check xmlrpc.client.Transport.make_connection().
I am not sure about the what kind of effect this may have.
I used chost as the parameter of set_tunnel(), rather than host (after briefly 
checking the code how it is calculated I felt that it's better to use chost 
than host, but I don't have a deep understanding of the http.client code).

The proxy_headers is a new thing, I guess it's a good thing if someone needs 
that.

I don't understand why the '*' character is needed in
connection = http.client.HTTPConnection(*self.proxy)
However I'm quite new to python.

I will try this new code tomorrow.

--

___
Python tracker 

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



Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-09 Thread Jussi Piitulainen
Chris Angelico writes:

> On Mon, Oct 10, 2016 at 12:26 AM, Dennis Lee Bieber wrote:
>> {This response is delayed as I'm waiting for the program to complete so I
>> can get the run time}
>> {Well... it's been near 24 hours and still merrily scrolling sums on my
>> console -- so I'm going to kill the running program}
>
> Eight BILLION of them. I wouldn't bother waiting for that.

Eight billion is a big number. I know from experience that computers can
compute a big number of computations in a short time. Therefore, I would
expect the computer to compute eight billion computations in a short
time. Maybe.

Apparently some big numbers are more big than others.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue28401] Don't support the PEP384 stable ABI in pydebug builds

2016-10-09 Thread Stefano Rivera

New submission from Stefano Rivera:

setup.py build for a library using py_limited_api will always generate a stable 
ABI tagged shared library, even under the pydebug interpreter.

This means that extensions that are built for a pydebug interpreter may be 
accidentally (and brokenly) imported in a non-dbg interpreter and vice-versa.

e.g. in python-librtmp, with cffi 1.8.3:
$ python3-dbg setup.py build
...
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions 
-Wl,-z,relro -Wl,-z,relro -g -Og 
-fdebug-prefix-map=/build/python3.5-H9Fri6/python3.5-3.5.2=. 
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time 
-D_FORTIFY_SOURCE=2 
build/temp.linux-x86_64-3.5-pydebug/build/temp.linux-x86_64-3.5-pydebug/librtmp._librtmp.o
 -lrtmp -o build/lib.linux-x86_64-3.5-pydebug/librtmp/_librtmp.abi3.so

Then:
$ cd build/lib.linux-x86_64-3.5-pydebug
$ python3 -c 'import librtmp'
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/tmp/python-librtmp-0.3.0/build/lib.linux-x86_64-3.5-pydebug/librtmp/__init__.py",
 line 8, in 
from ._librtmp import ffi, lib as librtmp
ImportError: 
/tmp/python-librtmp-0.3.0/build/lib.linux-x86_64-3.5-pydebug/librtmp/_librtmp.abi3.so:
 undefined symbol: _Py_RefTotal

setuptools decides whether to use the stable ABI, by looking at 
imp.get_suffixes(). And obviously, the importer is looking at that too. So, the 
stable ABI tag should simply not be in there.

PEP3149 agrees with this. It has this quote from Martin v. Löwis:
 --with-pydebug would not be supported by the stable ABI because this changes 
the layout of PyObject , which is an exposed structure.

So, here's a patch, to disable support for the stable ABI under pydebug builds.

--
components: Library (Lib)
files: pep384-pydbg.patch
keywords: patch
messages: 278381
nosy: stefanor
priority: normal
severity: normal
status: open
title: Don't support the PEP384 stable ABI in pydebug builds
type: behavior
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45040/pep384-pydbg.patch

___
Python tracker 

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



[issue25152] venv documentation doesn't tell you how to specify a particular version of python

2016-10-09 Thread R. David Murray

R. David Murray added the comment:

Issue 25154 has deprecated pyvenv in 3.6.  The docs, however, still need 
updating.  The updated docs should mention pyvenv only to say that it is 
deprecated, I think. This change could be applied to 3.5 if we get it in before 
3.5 final.

--
stage:  -> needs patch
type:  -> behavior
versions: +Python 3.7 -Python 3.4

___
Python tracker 

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



[issue28400] Remove uncessary checks in unicode_char and resize_copy

2016-10-09 Thread Xiang Zhang

New submission from Xiang Zhang:

In resize_copy we don't need to PyUnicode_READY(unicode) since when it's not 
PyUnicode_WCHAR_KIND it should be ready.

In unicode_char, PyUnicode_1BYTE_KIND is handled by get_latin1_char.

--
components: Interpreter Core
files: unicode_char_and_resize_copy.patch
keywords: patch
messages: 278379
nosy: haypo, serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
stage: patch review
status: open
title: Remove uncessary checks in unicode_char and resize_copy
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file45039/unicode_char_and_resize_copy.patch

___
Python tracker 

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



[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-09 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

I think this is the right way to fix this, as discussed on python-dev, 
memoryview is not considered consistent with ByteString.

--

___
Python tracker 

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



[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-09 Thread Guido van Rossum

Guido van Rossum added the comment:

Maybe this fix helps? I tried your repro and it no longer fails.

--

___
Python tracker 

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



[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 69fe5f2e5aae by Guido van Rossum in branch '3.5':
Issue #28339: Remove ByteString.register(memoryview(...)) from typing.py.
https://hg.python.org/cpython/rev/69fe5f2e5aae

New changeset 8958836a2c89 by Guido van Rossum in branch '3.6':
Issue #28339: Remove ByteString.register(memoryview(...)) from typing.py. 
(merge 3.5->3.6)
https://hg.python.org/cpython/rev/8958836a2c89

New changeset def461406c70 by Guido van Rossum in branch 'default':
Issue #28339: Remove ByteString.register(memoryview(...)) from typing.py. 
(merge 3.6->3.7)
https://hg.python.org/cpython/rev/def461406c70

--
nosy: +python-dev

___
Python tracker 

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



[issue28339] "TypeError: Parameterized generics cannot be used with class or instance checks" in test_functools after importing typing module

2016-10-09 Thread Guido van Rossum

Guido van Rossum added the comment:

Oh the line

ByteString.register(type(memoryview(b'')))

should be removed from typing.py.

--
priority: deferred blocker -> release blocker

___
Python tracker 

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



[issue28379] PyUnicode_CopyCharacters could lead to undefined behaviour

2016-10-09 Thread Xiang Zhang

Xiang Zhang added the comment:

Fine. :-)

--

___
Python tracker 

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



[issue28379] PyUnicode_CopyCharacters could lead to undefined behaviour

2016-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is just a cleaning up of not very important code.

--

___
Python tracker 

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



[issue27972] Confusing error during cyclic yield

2016-10-09 Thread Yury Selivanov

Yury Selivanov added the comment:

Thank you for reporting this! Closing the issue.

--
resolution:  -> fixed
stage:  -> 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



[issue27972] Confusing error during cyclic yield

2016-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8d877876aa89 by Yury Selivanov in branch '3.5':
Issue #27972: Prohibit Tasks to await on themselves.
https://hg.python.org/cpython/rev/8d877876aa89

New changeset 41c4f535b5c0 by Yury Selivanov in branch '3.6':
Merge 3.5 (issue #27972)
https://hg.python.org/cpython/rev/41c4f535b5c0

New changeset 47720192b318 by Yury Selivanov in branch 'default':
Merge 3.6 (issue #27972)
https://hg.python.org/cpython/rev/47720192b318

--
nosy: +python-dev

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-10-09 Thread Yury Selivanov

Yury Selivanov added the comment:

Yes, I think it's a good idea.

--

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-10-09 Thread INADA Naoki

INADA Naoki added the comment:

How about changing module name?
_asyncio_speedup for example.

--

___
Python tracker 

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



[issue28399] Remove UNIX socket from FS before binding

2016-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a3b162d5e70a by Yury Selivanov in branch '3.5':
Issue #28399: Remove UNIX socket from FS before binding.
https://hg.python.org/cpython/rev/a3b162d5e70a

New changeset 019c5c2f1239 by Yury Selivanov in branch '3.6':
Merge 3.5 (issue #28399)
https://hg.python.org/cpython/rev/019c5c2f1239

New changeset 2e5a8b4d9c97 by Yury Selivanov in branch 'default':
Merge 3.6 (issue #28399)
https://hg.python.org/cpython/rev/2e5a8b4d9c97

--
nosy: +python-dev

___
Python tracker 

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



[issue28399] Remove UNIX socket from FS before binding

2016-10-09 Thread Yury Selivanov

New submission from Yury Selivanov:

Proxy for https://github.com/python/asyncio/pull/441

--
assignee: yselivanov
components: asyncio
messages: 278367
nosy: gvanrossum, yselivanov
priority: normal
severity: normal
stage: resolved
status: open
title: Remove UNIX socket from FS before binding
type: enhancement
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue28399] Remove UNIX socket from FS before binding

2016-10-09 Thread Yury Selivanov

Changes by Yury Selivanov :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-10-09 Thread Yury Selivanov

Yury Selivanov added the comment:

I mean another optimization possibility.

--

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-10-09 Thread Yury Selivanov

Yury Selivanov added the comment:

Thank you, INADA!  Next task -- optimize asyncio.Task in C in 3.7. Another 
10-15% performance improvement.

--

___
Python tracker 

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



[issue28398] Return singleton empty string in _PyUnicode_FromASCII

2016-10-09 Thread Xiang Zhang

New submission from Xiang Zhang:

Right now in _PyUnicode_FromASCII, it only optimises for size 1 not size 0. All 
other places getting the same situation in unicodeobject.c do both.

--
files: _PyUnicode_FromASCII.patch
keywords: patch
messages: 278364
nosy: haypo, serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
stage: patch review
status: open
title: Return singleton empty string in _PyUnicode_FromASCII
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file45038/_PyUnicode_FromASCII.patch

___
Python tracker 

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



[issue25720] Fix curses module compilation with ncurses6

2016-10-09 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Thanks, building is fine here.

By the way, testing is broken due to other bugs (/tmp not available on 
Android). It's unrelated and I'll open a new issue for that.

--

___
Python tracker 

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



Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-09 Thread Chris Angelico
On Mon, Oct 10, 2016 at 12:26 AM, Dennis Lee Bieber
 wrote:
> {This response is delayed as I'm waiting for the program to complete so I
> can get the run time}
> {Well... it's been near 24 hours and still merrily scrolling sums on my
> console -- so I'm going to kill the running program}

Eight BILLION of them. I wouldn't bother waiting for that.

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


Re: Function to take the minimum of 3 numbers

2016-10-09 Thread Chris Angelico
On Mon, Oct 10, 2016 at 12:41 AM, BartC  wrote:
> The exercise says you must use an if/elif chain. The first thing that comes
> to mind is:
>
> def min3(a,b,c):
> if a<=b and a<=c:
> return a
> elif b<=a and b<=c:
> return b
> else:
> return c
>
> The bit about numbers tying for smallest is not meaningful; the caller can't
> tell if a minimum value of 42 came from a, b or c.

You assume that all equal numbers are identical. (And I say "numbers"
only because the problem definition did. This code does not require
numbers necessarily.)

>>> min3(1, True, 1.0)
1
>>> min3(1.0, True, 1)
1.0
>>> min3(True, 1.0, 1)
True
>>> 1 == 1.0 == True
True

>>> x = 1.0
>>> y = 1.0
>>> z = 1.0
>>> min3(x, y, z) is x
True
>>> min3(x, y, z) is y
False
>>> min3(x, y, z) is z
False

Your function provably returns the first number if given equal
numbers. That stipulation is far from meaningless; it explicitly
permits any means of selection, as long as one of the input values is
returned. Thus, for instance, this must always be valid:

>>> assert min3(x, y, z) in (x, y, z)

So this solution would NOT be valid:

def min2(a, b):
return (a+b)/2 - abs(a-b)/2
def min3(a, b, c):
return min2(a, min2(b, c))

It's mathematically perfect but inappropriate to this challenge, as it
violates the given rule.

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


[issue28389] xmlrpc.client HTTP proxy example code does not work

2016-10-09 Thread Berker Peksag

Changes by Berker Peksag :


--
resolution:  -> fixed
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



[issue28389] xmlrpc.client HTTP proxy example code does not work

2016-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 94c9c314f5d9 by Berker Peksag in branch '3.5':
Issue #28389: Fix ProxiedTransport example in xmlrpc.client documentation
https://hg.python.org/cpython/rev/94c9c314f5d9

New changeset 60c5c77c0190 by Berker Peksag in branch '3.6':
Issue #28389: Merge from 3.5
https://hg.python.org/cpython/rev/60c5c77c0190

New changeset 5f9351bc317e by Berker Peksag in branch 'default':
Issue #28389: Merge from 3.6
https://hg.python.org/cpython/rev/5f9351bc317e

--
nosy: +python-dev

___
Python tracker 

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



Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Paul Rubin
Gregory Ewing  writes:
> Not sure where I got [h|t] from -- maybe I was thinking of Prolog?)

I've never used Prolog.  Erlang is said to have Prolog-like syntax and
it uses [h|t], so maybe Prolog uses it too.  (Erlang was originally
written in Prolog).
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue28392] shlex - non-posix-mode: error in Multiple occurances of quotes substrings/words

2016-10-09 Thread R. David Murray

R. David Murray added the comment:

>>> shlex.split('"Do""This""Separate"', posix=False)
  ['"Do"', '"This"', '"Separate"']
  >>> shlex.split('Do"SeparateThis"', posix=False)
  ['Do"SeparateThis"']

Both of these are as documented.  The first has three separate words, since 
each word that starts with a leading " is split at the closing quote (thus 
producing a new word that starts with a ").  The last is one word, because the 
first " is internal to the word that starts at 'Do'.

In any case, if you find something that disagrees with the docs, we'll just 
change the docs, because posix=False exists only for backward compatibility so 
whatever the code actually does is by definition correct at this point.

--
resolution:  -> not a bug
stage:  -> 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: Function to take the minimum of 3 numbers

2016-10-09 Thread BartC

On 09/10/2016 13:01, Cai Gengyang wrote:

I'm moving on to chapter 9 
(http://programarcadegames.com/index.php?lang=en=lab_functions) of 
programarcadegames for the time being and going back to chapter 8 later (its just 
fucking frustrating and doesn't seem to work for the time being and I have a very 
bad temper).

At least for chapter 9, I got the first part correct at first try --- define a 
function that takes and prints the smallest of 3 numbers. I pasted it here for 
reference and discussion. The code can also be further modified to include a 
clause that says that if two numbers tie for smallest, choose any of the two 
numbers. (I will attempt to do it and then post it here again for future 
discussion with users here



def min3(a, b, c):

min3 = a
if b < min3:
min3 = b
if c < min3:
min3 = c
if b < c:
min3 = b
return min3


print(min3(4, 7, 5))

4



The exercise says you must use an if/elif chain. The first thing that 
comes to mind is:


def min3(a,b,c):
if a<=b and a<=c:
return a
elif b<=a and b<=c:
return b
else:
return c

The bit about numbers tying for smallest is not meaningful; the caller 
can't tell if a minimum value of 42 came from a, b or c.


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


[issue25720] Fix curses module compilation with ncurses6

2016-10-09 Thread Masayuki Yamamoto

Masayuki Yamamoto added the comment:

Thank you for confirming, Yen :)
In this case, It seems necessary that resolves headers. I think missing headers 
issue maybe solve by #28190. I wrote a join test patch for #28190 and #25720.
Would you be able to resolve headers using this?

--
Added file: 
http://bugs.python.org/file45037/join-test-issue28190-issue25720.patch

___
Python tracker 

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



[issue28379] PyUnicode_CopyCharacters could lead to undefined behaviour

2016-10-09 Thread Xiang Zhang

Xiang Zhang added the comment:

We don't need to remove it for 3.5 and 3.6?

--

___
Python tracker 

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



Re: Function to take the minimum of 3 numbers

2016-10-09 Thread Ben Bacarisse
Cai Gengyang  writes:

> I'm moving on to chapter 9
> (http://programarcadegames.com/index.php?lang=en=lab_functions)
> of programarcadegames for the time being and going back to chapter 8
> later (its just fucking frustrating and doesn't seem to work for the
> time being and I have a very bad temper).
>
> At least for chapter 9, I got the first part correct at first try ---
> define a function that takes and prints the smallest of 3 numbers. I
> pasted it here for reference and discussion.

Presumably you must do this without Python's min function?

> The code can also be
> further modified to include a clause that says that if two numbers tie
> for smallest, choose any of the two numbers.

What would be the point?  Your code already does that.

 def min3(a, b, c):
> min3 = a
> if b < min3:
> min3 = b
> if c < min3:
> min3 = c
> if b < c:
> min3 = b
> return min3

The last if is not needed.

Forced to pretend that there is no min function already, I'd be tempted
to write

  def min3(a, b, c):
  def min2(x, y):
  return x if x < y else y;
  return min2(a, min2(b, c))

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


[issue26081] Implement asyncio Future in C to improve performance

2016-10-09 Thread Berker Peksag

Changes by Berker Peksag :


--
stage: patch review -> resolved
versions: +Python 3.7

___
Python tracker 

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



[issue23782] Leak in _PyTraceback_Add

2016-10-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

More refactoring.

--
Added file: http://bugs.python.org/file45036/_PyTraceback_Add_leak2.patch

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-10-09 Thread INADA Naoki

INADA Naoki added the comment:

I close this issue for now.
Further improvements can be new issue.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue27945] Various segfaults with dict

2016-10-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +inada.naoki
versions: +Python 2.7, Python 3.7

___
Python tracker 

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



[issue28379] PyUnicode_CopyCharacters could lead to undefined behaviour

2016-10-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue28379] PyUnicode_CopyCharacters could lead to undefined behaviour

2016-10-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1be8cd7cee92 by Serhiy Storchaka in branch 'default':
Issue #28379: Removed redundant check.
https://hg.python.org/cpython/rev/1be8cd7cee92

--

___
Python tracker 

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



[issue28397] Faster index range checks

2016-10-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file45035/check_index.cocci

___
Python tracker 

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



[issue28397] Faster index range checks

2016-10-09 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The expression for testing that some index is in half-open range from 0 to 
limit can be written as

index >= 0 && index < limit

or as

(size_t)index < (size_t)limit

The latter form generates simpler machine code. This is idiomatic code, it is 
used in many C and C++ libraries (including C++ stdlib implementations). It 
already is used in CPython (in deque implementation).

Proposed patch rewrites index range checks in more efficient way. The patch was 
generated automatically by coccinelle script, and then manually cleaned up.

--
components: Extension Modules, Interpreter Core
files: check_index.patch
keywords: patch
messages: 278355
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Faster index range checks
type: performance
versions: Python 3.7
Added file: http://bugs.python.org/file45034/check_index.patch

___
Python tracker 

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



Function to take the minimum of 3 numbers

2016-10-09 Thread Cai Gengyang
I'm moving on to chapter 9 
(http://programarcadegames.com/index.php?lang=en=lab_functions) of 
programarcadegames for the time being and going back to chapter 8 later (its 
just fucking frustrating and doesn't seem to work for the time being and I have 
a very bad temper). 

At least for chapter 9, I got the first part correct at first try --- define a 
function that takes and prints the smallest of 3 numbers. I pasted it here for 
reference and discussion. The code can also be further modified to include a 
clause that says that if two numbers tie for smallest, choose any of the two 
numbers. (I will attempt to do it and then post it here again for future 
discussion with users here 


>>> def min3(a, b, c):
min3 = a
if b < min3:
min3 = b
if c < min3:
min3 = c
if b < c:
min3 = b
return min3

>>> print(min3(4, 7, 5))
4
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue28394] Spelling fixes

2016-10-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +martin.panter

___
Python tracker 

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



[issue28396] Remove *.pyo references from man page

2016-10-09 Thread Ville Skyttä

Changes by Ville Skyttä :


--
assignee: docs@python
components: Documentation
files: man-pyo.patch
keywords: patch
nosy: docs@python, scop
priority: normal
severity: normal
status: open
title: Remove *.pyo references from man page
type: enhancement
Added file: http://bugs.python.org/file45033/man-pyo.patch

___
Python tracker 

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



[issue28395] Remove unnecessary semicolons

2016-10-09 Thread Ville Skyttä

Changes by Ville Skyttä :


--
components: Tests
files: semicolons.patch
keywords: patch
nosy: scop
priority: normal
severity: normal
status: open
title: Remove unnecessary semicolons
type: enhancement
Added file: http://bugs.python.org/file45032/semicolons.patch

___
Python tracker 

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



[issue28394] Spelling fixes

2016-10-09 Thread Ville Skyttä

Changes by Ville Skyttä :


--
assignee: docs@python
components: Documentation
files: spelling.patch
keywords: patch
nosy: docs@python, scop
priority: normal
severity: normal
status: open
title: Spelling fixes
type: enhancement
Added file: http://bugs.python.org/file45031/spelling.patch

___
Python tracker 

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



[issue28393] Update encoding lookup docs wrt #27938

2016-10-09 Thread Ville Skyttä

New submission from Ville Skyttä:

The attached patch brings codecs docs up to date with respect to changes in 
#27938.

--
assignee: docs@python
components: Documentation
files: codecs-doc.patch
keywords: patch
messages: 278354
nosy: docs@python, haypo, scop
priority: normal
severity: normal
status: open
title: Update encoding lookup docs wrt #27938
type: enhancement
Added file: http://bugs.python.org/file45030/codecs-doc.patch

___
Python tracker 

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



Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread BartC

On 09/10/2016 11:35, Gregory Ewing wrote:

Paul Rubin wrote:

Gregory Ewing  writes:


http://www.cosc.canterbury.ac.nz/greg.ewing/essays/monads/DemystifyingMonads.html



https://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy/



Well, at least I refrained from saying that monads are
like burritos!

I don't claim that everyone will suddenly understand
everything there is to know about monads after reading
my essay. But maybe it will help some people understand
a little bit. It certainly couldn't help anyone if I
didn't write it.



I think the easiest way to deal with monads is pretend they don't exist. 
(I've no idea what they are, but from glancing at your essay, they look 
complicated.)


Even if someone did struggle for a week to figure out what they mean and 
how to use them, how is anyone else supposed to understand their code? 
How is anyone going to have confidence that any such code will work?


And Python (suddenly remembering which group this is) is supposed to be 
more accessible than other languages. It's not Haskell.


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


Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Gregory Ewing

Paul Rubin wrote:

Gregory Ewing  writes:


http://www.cosc.canterbury.ac.nz/greg.ewing/essays/monads/DemystifyingMonads.html


https://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy/


Well, at least I refrained from saying that monads are
like burritos!

I don't claim that everyone will suddenly understand
everything there is to know about monads after reading
my essay. But maybe it will help some people understand
a little bit. It certainly couldn't help anyone if I
didn't write it.

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


  1   2   >