On 12.10.16 04:30, Skip Montanaro wrote:
https://docs.python.org/3/whatsnew/3.1.html
It's the third hit when searching for 'float'. Assuming I understand
what it's saying. ;)
Thanks. Is that the "David Gay's algorithm"? That seems to apply only to
repr(), while the change I observed was in
Paul Rubin wrote:
Also if this operation is what it looks like, it's usually called
"bind". seq is something else entirely.
Ah, I hadn't realised there was already a function in
Haskell called seq -- sorry about that!
I don't really want to call the Python version 'bind',
because it seems a b
Anuradha Laxminarayan wrote:
seq f g h = f (\s1 -> g h s1)
better be written as
seq f g x = f (\s1 -> g x s1)
because naming conventions imply that h is function.
Well, for the subset of monads I'm talking about, it
always is a function -- it's the continuation to be
run after f and g.
--
G
On Tue, Oct 11, 2016 at 7:07 PM, Steve D'Aprano
wrote:
> I've just installed Python 3.5 from the source tarball and received an
> unexpected error related to pip. On Linux, as a regular user (except for
> the last line):
>
>
> wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz
> tar xvf
Dennis Lee Bieber wrote:
VMS documentation set was around 60 linear inches (two 30" shelves) of
3-ring binders. Amiga RKMs were five volumes with the main documentation in
fine print -- two "pages" side-by-side on a landscape page.
Apparently if you're writing software for the US Air Fo
On 10/11/2016 09:19 PM, Steven D'Aprano wrote:
> Completely off-topic, but too awesome not to share:
>
> The x86 assembly language "mov" instruction is Turing complete:
>
> https://www.cl.cam.ac.uk/~sd601/papers/mov.pdf
And apparently someone has taken this and made a small C compiler that
compi
On Wed, Oct 12, 2016 at 2:36 AM, wrote:
>
> I had try to find the document of the _winapi module, but can't find any in my
> installed Python directory. Can you give me a link to look for?
_winapi is not documented. It contains light wrappers around a small
set of Windows functions. It's ok for
Completely off-topic, but too awesome not to share:
The x86 assembly language "mov" instruction is Turing complete:
https://www.cl.cam.ac.uk/~sd601/papers/mov.pdf
Abstract
It is well-known that the x86 instruction set is baroque, overcom-
plicated, and redundantly redundant. We show jus
On 10/11/2016 9:30 PM, Skip Montanaro wrote:
https://docs.python.org/3/whatsnew/3.1.html
It's the third hit when searching for 'float'. Assuming I understand
what it's saying. ;)
Thanks. Is that the "David Gay's algorithm"? That seems to apply only to
repr(), while the change I observed was
On 10/11/2016 06:30 PM, Skip Montanaro wrote:
https://docs.python.org/3/whatsnew/3.1.html
It's the third hit when searching for 'float'. Assuming I understand what it's
saying. ;)
Thanks. Is that the "David Gay's algorithm"? That seems to apply only to
repr(), while the change I observed wa
wxjm...@gmail.com at 2016/10/11 9:40:21PM wrote:
> If you are about to modify your registry, do not
> forget to switch your Windows in a *utf-8 mode*.
Have no idea how to "switch" Windows in a "utf-8 mode"? What will happens if
not? Can you give a simple example? Thanks ahead.
--Jach
--
https:/
Hi, eryk, thanks for your solution.
I had try to find the document of the _winapi module, but can't find any in my
installed Python directory. Can you give me a link to look for?
> This alone doesn't make the Windows API case sensitive, but it does
> enable individual CreateFile calls to be case
Skip Montanaro writes:
> > Only that one should not rely on ‘str’ preserving the value accurately,
> > as documented in Python 2.
>
> Sure, but this choice is out of my hands. It's csv.writerow that calls
> str(), not me.
Ah, good old ‘csv’.
If the implementation is leaking an abstraction and y
On 10/11/2016 8:59 PM, Skip Montanaro wrote:
I'm trying to port some code from Python 2 to 3, and beyond the usual
mechanical stuff, I've encountered a difference between the str() of
floats. Here's an example. In Python 3 I get:
print(repr(27.04 - 0.01))
27.028
print(str(27.04 -
> Only that one should not rely on ‘str’ preserving the value accurately,
> as documented in Python 2.
Sure, but this choice is out of my hands. It's csv.writerow that calls
str(), not me. I could probably subclass csv.writer and csv.DictWriter, and
override the writerow method, but I would prefer
> https://docs.python.org/3/whatsnew/3.1.html
>
> It's the third hit when searching for 'float'. Assuming I understand
what it's saying. ;)
Thanks. Is that the "David Gay's algorithm"? That seems to apply only to
repr(), while the change I observed was in str().
Skip
--
https://mail.python.or
Skip Montanaro writes:
> >>> print repr(27.04 - 0.01)
> 27.028
> >>> print str(27.04 - 0.01)
> 27.03
>
> My test case writes through a csv writer, which writes the str() of each
> element to the output.
For Python 2, that's a mistake:
str(object='')
Return a string containi
On 10/11/2016 05:59 PM, Skip Montanaro wrote:
Is there documentation of this particular change? My searching turned up
documentation of plenty of other changes, but not this particular one.
3.1 What's new:
https://docs.python.org/3/whatsnew/3.1.html
It's the third hit when searching for 'f
I'm trying to port some code from Python 2 to 3, and beyond the usual
mechanical stuff, I've encountered a difference between the str() of
floats. Here's an example. In Python 3 I get:
>>> print(repr(27.04 - 0.01))
27.028
>>> print(str(27.04 - 0.01))
27.028
but in Python 2
I've just installed Python 3.5 from the source tarball and received an
unexpected error related to pip. On Linux, as a regular user (except for
the last line):
wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz
tar xvf Python-3.5.2.tgz
cd Python-3.5.2
./configure
make
sudo make altinst
On 10/11/2016 4:02 AM, Pierre-Alain Dorange wrote:
Using this function, the code is "compiled".
I do not think this function is often used and most python project
simply use the interpreter (which do a small translation into byte-code
to be faster and check syntax error before running interpreta
On 10/11/2016 11:50 AM, Daiyue Weng wrote:
Hi, I have the following code structure,
def one_func(param1, param2, param3):
process_outcome = {'dict': None}
outcome = another_func(param1, process_outcome, db_host=param2,
funcs_to_run=param3)
PyCharm warns me
Shadows name from outer sc
On 11/10/2016 22:26, Lawrence D’Oliveiro wrote:
On Wednesday, October 12, 2016 at 6:58:46 AM UTC+13, dhawan...@gmail.com wrote:
Only first loop is executing not the second one?
n=6
x=1
while x<=n:
print("*"*x)
x+=1
print('n=', n)
среда, 12 октября 2016 г., 4:29:02 UTC+10 пользователь Michael Torrie написал:
> On 10/11/2016 05:33 AM, Андрей Логунов wrote:
> > I need the Python Shell for use in education (turtle graphics, etc.),
> > but the UI must be localized in the Russian language. The question is
> > if it's at all possi
On 11/10/2016 17:30, Michael Torrie wrote:
On 10/11/2016 08:29 AM, Michael Felt wrote:
From reading the python source, and other projects I am looking to
patch I see that there is often a file __init__.py, sometimes empty
(only comments), sometimes not.
I have tried looking in what I hope are
On 11/10/2016 18:14, Steve D'Aprano wrote:
On Wed, 12 Oct 2016 12:19 am, BartC wrote:
Python is not really suited for AOT native-code compilation.
You might be right, but the author of Nuitka disagrees.
http://nuitka.net/
I tried the same thing with a dynamic language: translating byte-cod
On 11/10/2016 18:57, dhawanpawa...@gmail.com wrote:
def abc(a,b):
l=[]
for i in range(a,b+1):
if i%2!=0:
l.append(i)
print l
return 1
def bg():
y=abc(11,31)
print y
I am not getting the output, but if i call method abc outside the function then
it's
dhawanpawa...@gmail.com writes:
> n=6
> x=1
> while x<=n:
> print "*"*x
> x+=1
> while n>=x:
> n=n-1
> print "*"* n
>
>
> Only first loop is executing not the second one?
It's a basic fact about while loops that after the loop the condition is
false. The two conditions x <= n a
On 10/11/2016 11:57 AM, dhawanpawa...@gmail.com wrote:
> def abc(a,b):
> l=[]
> for i in range(a,b+1):
> if i%2!=0:
>
> l.append(i)
> print l
> return 1
>
> def bg():
> y=abc(11,31)
> print y
> I am not getting the output, but if i call
dhawanpawa...@gmail.com writes:
> def abc(a,b):
> l=[]
> for i in range(a,b+1):
> if i%2!=0:
>
> l.append(i)
> print l
> return 1
>
> def bg():
> y=abc(11,31)
> print y
>
> I am not getting the output, but if i call method abc outside th
On 10/11/2016 11:58 AM, dhawanpawa...@gmail.com wrote:
>
> n=6
> x=1
> while x<=n:
> print "*"*x
> x+=1
> while n>=x:
> n=n-1
> print "*"* n
>
>
> Only first loop is executing not the second one?
Did you try printing out the loop variable to see what it does and what
it is aft
On 10/11/2016 05:33 AM, Андрей Логунов wrote:
> I need the Python Shell for use in education (turtle graphics, etc.),
> but the UI must be localized in the Russian language. The question is
> if it's at all possible to feed the strings in or rebuild it or...
For educational purposes, you might fin
On Tue, Oct 11, 2016 at 1:58 PM, wrote:
>
> n=6
> x=1
> while x<=n:
> print "*"*x
> x+=1
> while n>=x:
> n=n-1
> print "*"* n
>
>
> Only first loop is executing not the second one?
Because after the first loop n < x
--
https://mail.python.org/mailman/listinfo/python-list
n=6
x=1
while x<=n:
print "*"*x
x+=1
while n>=x:
n=n-1
print "*"* n
Only first loop is executing not the second one?
--
https://mail.python.org/mailman/listinfo/python-list
def abc(a,b):
l=[]
for i in range(a,b+1):
if i%2!=0:
l.append(i)
print l
return 1
def bg():
y=abc(11,31)
print y
I am not getting the output, but if i call method abc outside the function then
it's coming
--
https://mail.python.org/mai
On Tuesday, October 11, 2016 at 9:53:25 PM UTC+5:30, Anuradha Laxminarayan
wrote:
> On Sunday, 9 October 2016 13:18:32 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/Demyst
Anuradha Laxminarayan writes:
> seq f g x = f (\s1 -> g x s1)
> because naming conventions imply that h is function.
Also if this operation is what it looks like, it's usually called
"bind". seq is something else entirely.
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, 12 Oct 2016 12:19 am, BartC wrote:
> Python is not really suited for AOT native-code compilation.
You might be right, but the author of Nuitka disagrees.
http://nuitka.net/
Nice to see that there's a new release, only a week or so ago!
--
Steve
“Cheer up,” they said, “things could
On Tue, 11 Oct 2016 03:58 pm, Terry Reedy wrote:
> On 10/10/2016 11:24 AM, Chris Angelico wrote:
>> On Tue, Oct 11, 2016 at 1:13 AM, wrote:
>>> Is there any way to capture syntax errors and process them ? I want to
>>> write a function which calls every time whenever there is syntax error
>>> in
On Tue, 11 Oct 2016 10:33 pm, Андрей Логунов wrote:
> I need the Python Shell for use in education (turtle graphics, etc.), but
> the UI must be localized in the Russian language. The question is if it's
> at all possible to feed the strings in or rebuild it or...
Yes it is possible, but it is pr
Grant Edwards wrote:
> > For my part, i differenciate a strict compilation (ie. C) from a
> > translation into byte-code (ie. Python).
>
> FWIW I've seen C compilers that produced byte-code. They allowed for
> a highly interactive developemnt environment.
I do not want to fight every word and
On 2016-10-11, Pierre-Alain Dorange wrote:
> For my part, i differenciate a strict compilation (ie. C) from a
> translation into byte-code (ie. Python).
FWIW I've seen C compilers that produced byte-code. They allowed for
a highly interactive developemnt environment.
--
Grant Edwards
On Sunday, 9 October 2016 13:18:32 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, that made a very interesting read.
Hi, I have the following code structure,
def one_func(param1, param2, param3):
process_outcome = {'dict': None}
outcome = another_func(param1, process_outcome, db_host=param2,
funcs_to_run=param3)
PyCharm warns me
Shadows name from outer scope
on every variable here, param1,2,3, proc
On 10/11/2016 08:29 AM, Michael Felt wrote:
> From reading the python source, and other projects I am looking to
> patch I see that there is often a file __init__.py, sometimes empty
> (only comments), sometimes not.
>
> I have tried looking in what I hope are the "regular" places such as:
> h
From reading the python source, and other projects I am looking to
patch I see that there is often a file __init__.py, sometimes empty
(only comments), sometimes not.
I have tried looking in what I hope are the "regular" places such as:
https://docs.python.org, readthedocs (it took 454 second
On 11/10/2016 13:49, Dennis Lee Bieber wrote:
Unfortunately, Windows is one of the poorest documented OS I've
encountered
The problem is more that there is too much documentation!
--
Bartc
--
https://mail.python.org/mailman/listinfo/python-list
On 11/10/2016 13:35, Pierre-Alain Dorange wrote:
Ben Finney wrote:
The "small translation into byte-code" *is* compilation.
Don't make the mistake that the only product of "compile" is some CPU
code; that is a foolishly narrow definition.
OK right.
For my part, i differenciate a strict comp
On Tue, Oct 11, 2016 at 10:34 AM, wrote:
> I have two files in the Q:\lib directory:
>
> Q:\lib>dir
> 2007/03/11 AM 08:025,260 lib_MARK.so
> 2007/03/11 AM 08:024,584 lib_mark.so
>
> Under Python 3.4.4 I got:
>
f = open('lib_MARK.so', 'br')
data = f.read()
f.close(
Ben Finney wrote:
> The "small translation into byte-code" *is* compilation.
>
> Don't make the mistake that the only product of "compile" is some CPU
> code; that is a foolishly narrow definition.
OK right.
For my part, i differenciate a strict compilation (ie. C) from a
translation into byte-
I need the Python Shell for use in education (turtle graphics, etc.), but the
UI must be localized in the Russian language. The question is if it's at all
possible to feed the strings in or rebuild it or...
--
https://mail.python.org/mailman/listinfo/python-list
I have two files in the Q:\lib directory:
Q:\lib>dir
2007/03/11 AM 08:025,260 lib_MARK.so
2007/03/11 AM 08:024,584 lib_mark.so
Under Python 3.4.4 I got:
>>> f = open('lib_MARK.so', 'br')
>>> data = f.read()
>>> f.close()
>>> len(data)
4584
I know Windows won't, but can Python
Chris Angelico :
>>> > You're right, except that Python is never compiled, it was just
>>> > checked for syntax error before interpreting code.
>>>
>>> https://docs.python.org/3/library/functions.html#compile
>>>
>>> It's compiled.
>>
>> Using this function, the code is "compiled".
>> I do not thi
pdora...@pas-de-pub-merci.mac.com (Pierre-Alain Dorange) writes:
> Chris Angelico wrote:
>
> > https://docs.python.org/3/library/functions.html#compile
> >
> > [Python code is] compiled.
>
> Using this function, the code is "compiled".
You have it backward: Python code is compiled. That's what
On Tue, Oct 11, 2016 at 7:02 PM, Pierre-Alain Dorange
wrote:
> Chris Angelico wrote:
>
>> >> Yes and no. Syntax errors are detected when the script is compiled, so
>> >> you can't do something like this:
>> >
>> > You're right, except that Python is never compiled, it was just checked
>> > for sy
Chris Angelico wrote:
> >> Yes and no. Syntax errors are detected when the script is compiled, so
> >> you can't do something like this:
> >
> > You're right, except that Python is never compiled, it was just checked
> > for syntax error before interpreting code.
>
> https://docs.python.org/3/li
56 matches
Mail list logo