Re: New Python student needs help with execution

2015-06-11 Thread Laura Creighton
In a message of Wed, 10 Jun 2015 21:50:54 -0700, c me writes:
I installed 2.7.9 on a Win8.1 machine. The Coursera instructor did a simple 
install then executed Python from a file in which he'd put a simple hello 
world script.  My similar documents folder cannot see the python executable.  
How do I make this work?
-- 
https://mail.python.org/mailman/listinfo/python-list

You need to set your PYTHONPATH.
Instructions here should help.
https://docs.python.org/2.7/using/windows.html

It is possible that you need to do some other things too, but again
that's the doc for it.

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


PYTHON QUESTION

2015-06-11 Thread adebayo . abraham
Help with this problem!

Temperature converter
Description

Write two functions that will convert temperatures back and forth from the 
Celsius and Fahrenheit temperature scales. The formulas for making the 
conversion are as follows:

  Tc=(5/9)*(Tf-32)
  Tf=(9/5)*Tc+32

where Tc is the Celsius temperature and Tf is the Fahrenheit temperature. More 
information and further descriptions of how to do the conversion can be found 
at this NASA Webpage. If you finish this assignment quickly, add a function to 
calculate the wind chill.
Input

Your program should ask the user to input a temperature and then which 
conversion they would like to perform.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue24429] msvcrt error when embedded

2015-06-11 Thread erik flister

New submission from erik flister:

normally, CDLL(find_library('c')) is fine.  but when running embedded in a 
context that uses a different runtime version, this will cause an error 
(example: 
http://stackoverflow.com/questions/30771380/how-use-ctypes-with-msvc-dll-from-within-matlab-on-windows/).

using ctypes.cdll.msvcrt apparently finds the correct runtime.  i was surprised 
by this, i thought this was supposed to be identical to find_library('c').

in any case, some libraries (uuid.py) use the one that breaks.  can you either 
switch everything to ctypes.cdll.msvcrt, or have find_library('c') change to be 
identical to it?

--
components: Library (Lib), Windows, ctypes
messages: 245162
nosy: erik flister, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: msvcrt error when embedded
type: behavior
versions: Python 2.7

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



Re: I don't like the OO part of python. In particular the self keyword everywhere.

2015-06-11 Thread Chris Angelico
On Thu, Jun 11, 2015 at 9:27 PM, Skybuck Flying skybuck2...@hotmail.com wrote:
 If I wanted to access a global variable I would use the existing global
 thing

 global SomeField...

 maybe if I wanted to use a local variable for routine:

 local SomeField...

 seems nicer... then having to use self everywhere...

Oops, missent.

If you want this, how about simply declaring all function-local
variables, and having everything else be implicitly global? Or declare
(with data type) all globals, all class attributes, and all locals,
and then let the compiler figure out what you want? Because if you
want ECMAScript or C++, you know where to find them.

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


Re: enhancement request: make py3 read/write py2 pickle format

2015-06-11 Thread Serhiy Storchaka

On 11.06.15 02:58, Chris Angelico wrote:

On Thu, Jun 11, 2015 at 8:10 AM, Devin Jeanpierre
jeanpierr...@gmail.com wrote:

The problem is that there are two different ways repr might write out
a dict equal to {'a': 1, 'b': 2}. This can make tests brittle -- e.g.
it's why doctest fails badly at examples involving dictionaries. Text
format protocol buffers output everything sorted, so that you can do
textual diffs for compatibility tests and such.


With Python's JSON module [1], you can pass sort_keys=True to
stipulate that the keys be lexically ordered, which should make the
output canonical. Pike's Standards.JSON.encode() [2] can take a flag
value to canonicalize the output, which currently has the same effect
(sort mappings by their indices). I did a quick check for Ruby and
didn't find anything in its standard library JSON module, but knowing
Ruby, it'll be available somewhere in a gem.


AFAIK Ruby's dicts are ordered. So the output is pretty stable.


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


Re: Parser needed.

2015-06-11 Thread Skybuck Flying

Well it did help a little bit.

Somebody asked if there was already a parser for it.

I answered yes in C#.

So I took a closer look at it... and learned something from it.

Maybe I would have done that anyway... or maybe not...

Now we will never know... but I am happy that the parser is now ok, done and 
pretty easy extendable.


I think it's probably my first really good one.

I did do a little assembler before... but not sure if it was any good.

I also read before I started the thread... what parse means in dictionary.

That also helped me understand it a little bit better.

And also I read how it's usually done... tokens/tokenize etc... kinda 
already knew that... but still.


Turned out to be quite easy...

But at the start /always it seemed so difficult...

So any little bits of help/advice/information can help ! :)

Bye,
 Skybuck. 


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


Re: A basic dictionary question

2015-06-11 Thread Peter Otten
David Aldrich wrote:

 Hi
 
 I am fairly new to Python.  I am writing some code that uses a dictionary
 to store definitions of hardware registers.  Here is a small part of it:
 
 import sys
 
 register = {
 'address'  : 0x3001c,
 'fields' : {
 'FieldA' : {
 'range' : (31,20),
 },
 'FieldB' : {
 'range' : (19,16),
 },
 },
 'width' : 32
 };
 
 def main():
 fields = register['fields']
 for field, range_dir in fields: == This line fails
 range_dir = field['range']
 x,y = range_dir['range']
 print(x, y)
 
 if __name__ == '__main__':
 main()
 
 I want the code to print the range of bits of each field defined in the
 dictionary.
 
 The output is:
 
 Traceback (most recent call last):
   File testdir.py, line 32, in module
 main()
   File testdir.py, line 26, in main
 for field, range_dir in fields:
 ValueError: too many values to unpack (expected 2)
 
 Please will someone explain what I am doing wrong?

for key in some_dict:
...

iterates over the keys of the dictionary, for (key, value) pairs you need

for key, value in some_dict.items():
...

 
 Also I would like to ask how I could print the ranges in the order they
 are defined.  Should I use a different dictionary class or could I add a
 field to the dictionary/list to achieve this?

Have a look at collections.OrderedDict:

https://docs.python.org/dev/library/collections.html#collections.OrderedDict

If you don't care about fast access by key you can also use a list of 
(key, value) pairs.



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


Re: A basic dictionary question

2015-06-11 Thread MRAB

On 2015-06-11 11:10, David Aldrich wrote:

Hi

I am fairly new to Python.  I am writing some code that uses a
dictionary to store definitions of hardware registers.  Here is a small
part of it:

import sys

register = {

 'address'  : 0x3001c,

 'fields' : {

 'FieldA' : {

 'range' : (31,20),

 },

 'FieldB' : {

 'range' : (19,16),

 },

 },

 'width' : 32

};

def main():

 fields = register['fields']

 for field, range_dir in fields: == This line fails

 range_dir = field['range']

 x,y = range_dir['range']

 print(x, y)

if __name__ == '__main__':

 main()

I want the code to print the range of bits of each field defined in the
dictionary.

The output is:

Traceback (most recent call last):

   File testdir.py, line 32, in module

 main()

   File testdir.py, line 26, in main

 for field, range_dir in fields:

ValueError: too many values to unpack (expected 2)

Please will someone explain what I am doing wrong?


You're iterating over the keys. What you want is to iterate over
fields.items() which gives the key/value pairs.


Also I would like to ask how I could print the ranges in the order they
are defined.  Should I use a different dictionary class or could I add a
field to the dictionary/list to achieve this?


Dicts are unordered. Try 'OrderedDict' from the 'collections' module.

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


[issue12833] raw_input misbehaves when readline is imported

2015-06-11 Thread Martin Panter

Martin Panter added the comment:

Actually, there should either be a space before the double-colons, or the full 
stops should be removed. So either of these options:

. . . when a backspace is typed. ::
. . . when a backspace is typed::

--

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



Re: PYTHON QUESTION

2015-06-11 Thread David Palao
2015-06-11 12:44 GMT+02:00  adebayo.abra...@gmail.com:
 Help with this problem!

 Temperature converter
 Description

 Write two functions that will convert temperatures back and forth from the 
 Celsius and Fahrenheit temperature scales. The formulas for making the 
 conversion are as follows:

   Tc=(5/9)*(Tf-32)
   Tf=(9/5)*Tc+32

 where Tc is the Celsius temperature and Tf is the Fahrenheit temperature. 
 More information and further descriptions of how to do the conversion can be 
 found at this NASA Webpage. If you finish this assignment quickly, add a 
 function to calculate the wind chill.
 Input

 Your program should ask the user to input a temperature and then which 
 conversion they would like to perform.
 --
 https://mail.python.org/mailman/listinfo/python-list

Hello,
While people here is kindly helping others, it doesn't work the way
you are posing it: we will not do your homeworks.
If you want some help, please, present some code that you wrote and
does not work, or a specific question about the problem. For instance,
how can I write a function in python?
BTW, probably your questions should go to the tutor mailing list...

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


Re: I don't like the OO part of python. In particular the self keyword everywhere.

2015-06-11 Thread Skybuck Flying

Another typo corrected... see (*)

Skybuck Flying  wrote in message 
news:2c87e$55796f2c$5419aafe$47...@news.ziggo.nl...


Little typo corrected... it's a common typo I seem to make.

with had to be without see ***.

Skybuck Flying  wrote in message news:...

Hello,

I don't like the object orientated part of Python.

The idea/prospect of having to write self everywhere... seems very
horrorific and a huge time waster.

(Perhaps the module thing of python might help in future not sure about
that).

What are your thoughts on the self thing/requirement.

I only want replies from expert programmers, cause we need a language for
expert programmers...

Not noobies that need to be hand-held...

Personally I think I could do just fine without (***) the self keyword
everywhere.

So question is... can the python interpreter/compiler be written in such a
way that self can be left out ?

In other words: Is there any hope... that this part of the language will be
cleaned up some day ?

Are there any tricks to get rid of it ?

Maybe with (*) like in Delphi ?

I haven't written much OO code yet in Python... and don't plan on doing it
too...

Cause it looks hellish confusing... and clouded/clodded.

I think I have better things to do then to insert self everywhere...

It's almost like self masturbation  LOL.

Bye,
 Skybuck =D

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


Re: I don't like the OO part of python. In particular the self keyword everywhere.

2015-06-11 Thread Skybuck Flying

Little typo corrected... it's a common typo I seem to make.

with had to be without see ***.

Skybuck Flying  wrote in message news:...

Hello,

I don't like the object orientated part of Python.

The idea/prospect of having to write self everywhere... seems very
horrorific and a huge time waster.

(Perhaps the module thing of python might help in future not sure about
that).

What are your thoughts on the self thing/requirement.

I only want replies from expert programmers, cause we need a language for
expert programmers...

Not noobies that need to be hand-held...

Personally I think I could do just fine without (***) the self keyword 
everywhere.


So question is... can the python interpreter/compiler be written in such a
way that self can be left out ?

In other words: Is there any hope... that this part of the language will be
cleaned up some day ?

Are there any tricks to get rid of it ?

Maybe white like in Delphi ?

I haven't written much OO code yet in Python... and don't plan on doing it
too...

Cause it looks hellish confusing... and clouded/clodded.

I think I have better things to do then to insert self everywhere...

It's almost like self masturbation  LOL.

Bye,
 Skybuck =D 


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


Re: I don't like the OO part of python. In particular the self keyword everywhere.

2015-06-11 Thread Chris Angelico
On Thu, Jun 11, 2015 at 9:27 PM, Skybuck Flying skybuck2...@hotmail.com wrote:
 If I wanted to access a global variable I would use the existing global
 thing

 global SomeField...

 maybe if I wanted to use a local variable for routine:

 local SomeField...

 seems nicer... then having to use self everywhere...
-- 
https://mail.python.org/mailman/listinfo/python-list


A basic dictionary question

2015-06-11 Thread David Aldrich
Hi

I am fairly new to Python.  I am writing some code that uses a dictionary to 
store definitions of hardware registers.  Here is a small part of it:

import sys

register = {
'address'  : 0x3001c,
'fields' : {
'FieldA' : {
'range' : (31,20),
},
'FieldB' : {
'range' : (19,16),
},
},
'width' : 32
};

def main():
fields = register['fields']
for field, range_dir in fields: == This line fails
range_dir = field['range']
x,y = range_dir['range']
print(x, y)

if __name__ == '__main__':
main()

I want the code to print the range of bits of each field defined in the 
dictionary.

The output is:

Traceback (most recent call last):
  File testdir.py, line 32, in module
main()
  File testdir.py, line 26, in main
for field, range_dir in fields:
ValueError: too many values to unpack (expected 2)

Please will someone explain what I am doing wrong?

Also I would like to ask how I could print the ranges in the order they are 
defined.  Should I use a different dictionary class or could I add a field to 
the dictionary/list to achieve this?

Best regards

David

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


I don't like the OO part of python. In particular the self keyword everywhere.

2015-06-11 Thread Skybuck Flying

Hello,

I don't like the object orientated part of Python.

The idea/prospect of having to write self everywhere... seems very 
horrorific and a huge time waster.


(Perhaps the module thing of python might help in future not sure about 
that).


What are your thoughts on the self thing/requirement.

I only want replies from expert programmers, cause we need a language for 
expert programmers...


Not noobies that need to be hand-held...

Personally I think I could do just fine with the self keyword everywhere.

So question is... can the python interpreter/compiler be written in such a 
way that self can be left out ?


In other words: Is there any hope... that this part of the language will be 
cleaned up some day ?


Are there any tricks to get rid of it ?

Maybe white like in Delphi ?

I haven't written much OO code yet in Python... and don't plan on doing it 
too...


Cause it looks hellish confusing... and clouded/clodded.

I think I have better things to do then to insert self everywhere...

It's almost like self masturbation  LOL.

Bye,
 Skybuck =D 


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


Re: enhancement request: make py3 read/write py2 pickle format

2015-06-11 Thread Steven D'Aprano
On Thursday 11 June 2015 15:39, Devin Jeanpierre wrote:

 But I'm not talking about re-inventing what already exists. If I want
 JSON, I'll use JSON, not spend weeks or months re-writing it from
 scratch. I can't do this:

 class MyClass:
pass

 a = MyClass()
 serialised = repr(a)
 b = ast.literal_eval(serialised)
 assert a == b
 
 I don't understand. You can't do that in JSON, YAML, XML, or protocol
 buffers, either. They only provide a small set of types, comparable to
 (but smaller) than the set of types you get from literal_eval/repr.

Well, what do people do when they want to serialise something like MyClass, 
but have to use (say) JSON rather than pickle?

I'd write a method to export enough information (as JSON) to reconstruct the 
instance, and another method to take that JSON and build an instance. If I'm 
going to do all that, *I would use JSON* rather than try to create my own 
format invented from scratch using only literal_eval.


Although... I suppose if I really wanted to be quick and dirty about it...


py import ast
py class MyClass(object): pass
... 
py a = MyClass()
py s = repr(a.__dict__)
py b = object.__new__(MyClass)
py b.__dict__ = ast.literal_eval(s)
py b
__main__.MyClass object at 0xb725218c


;-)



-- 
Steve

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


[issue672115] Assignment to __bases__ of direct object subclasses

2015-06-11 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
type: behavior - enhancement
versions: +Python 3.6 -Python 3.5

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



Re: I don't like the OO part of python. In particular the self keyword everywhere.

2015-06-11 Thread Skybuck Flying

Then again...

I also believe the highest goal for a programming language is natural 
spoken language.


If self.somefield equals 10 then...

Does have some understandable ring to it.

However... time constraints also have to be kept in mind.

In another words if the code looks like

begin of class section

if somefield equals 10 then...


end of class section

Should be pretty obvious that somefield belongs to class section...

So no need to specify self...

If I wanted to access a global variable I would use the existing global 
thing


global SomeField...

maybe if I wanted to use a local variable for routine:

local SomeField...

seems nicer... then having to use self everywhere...

Bye,
 Skybuck. 


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


[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS (update: and NetBSD w/ FFS, Solaris w/ UFS)

2015-06-11 Thread koobs

koobs added the comment:

Additionally on koobs-freebsd9, in my home directory (which is on ZFS)

The buildbot home directories are on UFS

--

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



[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS (update: and NetBSD w/ FFS, Solaris w/ UFS)

2015-06-11 Thread koobs

koobs added the comment:

Larry: The same two hosts that the FreeBSD Python buildslaves run on :)

--

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



[issue24431] StreamWriter.drain is not callable concurrently

2015-06-11 Thread Martin Teichmann

New submission from Martin Teichmann:

Currently there is an assert statement asserting that no two
tasks (asyncio tasks, that is) can use StreamWriter.drain at
the same time. This is a weird limitiation, if there are two
tasks writing to the same network socket, there is no reason
why not both of them should drain the socket after (or before)
writing to it.

A simple bug fix is attached.

--
components: asyncio
files: patch
messages: 245172
nosy: Martin.Teichmann, gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: StreamWriter.drain is not callable concurrently
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file39681/patch

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



Re: New Python student needs help with execution

2015-06-11 Thread Chris Warrick
On Thu, Jun 11, 2015 at 10:52 AM, Laura Creighton l...@openend.se wrote:
 In a message of Wed, 10 Jun 2015 21:50:54 -0700, c me writes:
I installed 2.7.9 on a Win8.1 machine. The Coursera instructor did a simple 
install then executed Python from a file in which he'd put a simple hello 
world script.  My similar documents folder cannot see the python executable.  
How do I make this work?
--
https://mail.python.org/mailman/listinfo/python-list

 You need to set your PYTHONPATH.
 Instructions here should help.
 https://docs.python.org/2.7/using/windows.html

 It is possible that you need to do some other things too, but again
 that's the doc for it.

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

It’s actually %PATH%. %PYTHONPATH% does something different and is not
really useful to newcomers (especially since there are much better
ways to accomplish what it does)

-- 
Chris Warrick https://chriswarrick.com/
PGP: 5EAAEA16
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: I don't like the OO part of python. In particular the self keyword everywhere.

2015-06-11 Thread Michael Torrie
On 06/11/2015 05:19 AM, Skybuck Flying wrote:
 I haven't written much OO code yet in Python... and don't plan on doing it 
 too...

Except that you already have written OO code in Python with your parser.
 Or at least code that interacts heavily with OO.  Anytime you call a
method on a string like split(), or worked with regular expressions, you
are using OO.  OO permeates Python.  You don't have to use OO design in
your programs, but you will always be working with objects and calling
methods on them.

But anyway, if you don't like self, use a different name.  Like skybuck.

class Bar:
def foo(skybuck, a, b):
skybuck.a = a
skybuck.b = b

In other languages with an implicit self or this like C, I find the
ambiguities of scope highly problematic.  Method variables can shadow
instance variables.  It's also difficult for someone unfamiliar with the
code to differentiate between a local variable and an instance variable
as the naked variable name has no qualifier.  I've seen some projects
that apply a m_ prefix to every instance variable so you can tell them
apart.  Sure that's less typing, but it is super ugly!  Explicitly
providing self not only makes things very clear, it also helps me when
I'm scrolling through code to identify which functions definitions are
bare functions and which are methods of a class.

In short, it's part of the Python language and will not be changing
anytime soon.  So no the interpreter couldn't be written in such a way
that the self can be left out without changing the language's semantics
and definition.

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


[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS (update: and NetBSD w/ FFS, Solaris w/ UFS)

2015-06-11 Thread R. David Murray

R. David Murray added the comment:

Note that the shorter patch means that the test is not actually testing what 
the comments say it is testing, so either the comments should admit we are 
checking that the result is something close to what we set, or the longer fix 
should be used so as to continue to use the more rigorous test on platforms 
that support it.  Ideally the latter.

--
nosy: +r.david.murray

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



[issue24432] Upgrade windows builds to use OpenSSL 1.0.2b

2015-06-11 Thread Alex Gaynor

New submission from Alex Gaynor:

https://www.openssl.org/news/secadv_20150611.txt

--
components: Library (Lib)
keywords: security_issue
messages: 245173
nosy: alex, christian.heimes, dstufft, giampaolo.rodola, janssen, paul.moore, 
pitrou, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Upgrade windows builds to use OpenSSL 1.0.2b

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



[issue24429] msvcrt error when embedded

2015-06-11 Thread Steve Dower

Steve Dower added the comment:

msvcrt isn't the right version, it just happens to load. It's actually an old, 
basically unsupported version.

The problem would seem to be that Python 2.7 does not activate its activation 
context before loading msvcrt90 via ctypes. Eryksun (nosied - hope you're the 
same one :) ) posted a comment on the SO post with a link to a separate answer 
that shows how to do it, but it would be better for MATLAB to embed the 
manifest in their host executable if they're going to load the DLL directly.

We could probably also condition uuid to not do that check on Windows, since I 
don't think those functions will ever exist, at least against 2.7 they won't.

--
nosy: +eryksun

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



[issue24433] There is no asyncio.ensure_future in Python 3.4.3

2015-06-11 Thread Олег Иванов

New submission from Олег Иванов:

Docs claims there there is asyncio.ensure_future

https://docs.python.org/3/library/asyncio-task.html?highlight=ensure_future#asyncio.ensure_future

but example from docs does'nt work:

import asyncio

loop = asyncio.get_event_loop()
tasks = [
asyncio.ensure_future(print(asasda)),

]
loop.run_until_complete(asyncio.wait(tasks))
loop.close()

Fails with:

AttributeError: 'module' object has no attribute 'ensure_future'

--
assignee: docs@python
components: Documentation
messages: 245176
nosy: docs@python, Олег Иванов
priority: normal
severity: normal
status: open
title: There is no asyncio.ensure_future in Python 3.4.3
type: behavior
versions: Python 3.4

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



[issue24433] There is no asyncio.ensure_future in Python 3.4.3

2015-06-11 Thread Zachary Ware

Zachary Ware added the comment:

The docs also say New in version 3.4.4 :)

--
nosy: +zach.ware
resolution:  - not a bug
stage:  - resolved
status: open - closed

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



[issue24432] Upgrade windows builds to use OpenSSL 1.0.2b

2015-06-11 Thread Ned Deily

Ned Deily added the comment:

Marking as release blocker for 3.5.0

--
nosy: +benjamin.peterson, larry, ned.deily
priority: normal - release blocker
stage:  - needs patch
versions: +Python 2.7, Python 3.4, Python 3.5, Python 3.6

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



[issue24400] Awaitable ABC incompatible with functools.singledispatch

2015-06-11 Thread Guido van Rossum

Guido van Rossum added the comment:

FYI I am on vacation and don't have the bandwidth to look into this, so I
hope you will all work together to find a solution without my help.

--

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



[issue24434] ItemsView.__contains__ does not mimic dict_items

2015-06-11 Thread Caleb Levy

Changes by Caleb Levy caleb.l...@berkeley.edu:


--
components: Library (Lib)
nosy: clevy, rhettinger, stutzbach
priority: normal
severity: normal
status: open
title: ItemsView.__contains__ does not mimic dict_items
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

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



[issue24435] Grammar/Grammar points to outdated guide

2015-06-11 Thread Chris Angelico

New submission from Chris Angelico:

Grammar/Grammar points to PEP 306, which points instead to the dev guide. The 
exact link is not provided, but it'd be useful to skip the PEP altogether and 
just link to https://docs.python.org/devguide/grammar.html in the file.

--
messages: 245180
nosy: Rosuav
priority: normal
severity: normal
status: open
title: Grammar/Grammar points to outdated guide

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



[issue22483] Copyright infringement on PyPI

2015-06-11 Thread Andrew

Andrew added the comment:

So, I think I need to explain the situation. 

At first, changes in package was made by me, but package was intended for use 
in internal pypi (in scope of company). I don't know how it appeared here.

Why did I do that? Original package was not installable via pip at all.

What was changed? MANIFEST.in (just one line) and nothing more.

--
nosy: +andrew.pypi

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



[issue24434] ItemsView.__contains__ does not mimic dict_items

2015-06-11 Thread Caleb Levy

New submission from Caleb Levy:

The current implementation ItemsView.__contains__ reads

class ItemsView(MappingView, Set):
...
def __contains__(self, item):
key, value = item
try:
v = self._mapping[key]
except KeyError:
return False
else:
return v == value
...

This poses several problems. First, any non-iterable or iterable not having 
exactly two elements will raise an error instead of returning false. 

Second, an ItemsView object is roughly the same as a set of tuple-pairs hashed 
by the first element. Thus, for example,

[a, 1] in d.items()

will return False for any dict d, yet in the current ItemsView implementation, 
this is True.

The patch changes behavior to immediately return false for non-tuple items and 
tuples not of length 2, avoiding unnecessary exceptions. It also adds tests to 
collections which fail under the old behavior and pass with the update.

--
keywords: +patch
Added file: http://bugs.python.org/file39682/ItemsView_contains.patch

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



[issue23830] Add AF_IUCV support to sockets

2015-06-11 Thread Neale Ferguson

Neale Ferguson added the comment:

Updated patch against head (96580:3156dd82df2d). Built on s390x and x86_64. 
Test suite ran on both - tests successfully ignored on x86_64 and passed on 
s390x.

--
versions: +Python 3.6 -Python 3.5
Added file: http://bugs.python.org/file39683/af_iucv_cpython.patch

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



Re: I don't like the OO part of python. In particular the self keyword everywhere.

2015-06-11 Thread MRAB

On 2015-06-11 12:27, Skybuck Flying wrote:

Then again...

I also believe the highest goal for a programming language is natural
spoken language.


Natural language is full of ambiguities.


If self.somefield equals 10 then...

Does have some understandable ring to it.

However... time constraints also have to be kept in mind.

In another words if the code looks like

begin of class section


Shouldn't that be beginning of class section?


if somefield equals 10 then...


end of class section


You should have a look at Cobol. If was designed with a more natural-
looking syntax so that business managers could write their own code.

It turned out that the managers didn't write code because programming
harder then they anticipated.

Then there's AppleScript. It also tries to have a more natural-looking
syntax, but the problem is that it's then not so clear what's legal.
For example, it allows title of window or window's title. So what
is the title of the script's title? It's title of window of me or
me's window's title. Yes, me's, not my. It's an example of the
Uncanny Valley.

I prefer a language that doesn't look like a natural language, because
it isn't, that's not its purpose.


Should be pretty obvious that somefield belongs to class section...

So no need to specify self...

If I wanted to access a global variable I would use the existing global
thing

global SomeField...

maybe if I wanted to use a local variable for routine:

local SomeField...

seems nicer... then having to use self everywhere...


then? Should be than... (That seems to be happening more and more
these days...)

Anyway, the use of self is something that's not going to change.

If you don't like it, there are plenty of other programming languages
out there for you to try.

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


[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS (update: and NetBSD w/ FFS, Solaris w/ UFS)

2015-06-11 Thread koobs

koobs added the comment:

I have tested both patches (test_os by trent) and almostequaltime by harrison 
on the default branch, and *both* result in test_os passing.

They also resolve the test_utime failure reported in bug 24175 and very likely 
16287 (born from this issue)

--
versions: +Python 3.6

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



Writting Dialog to enter preset items from a combo list

2015-06-11 Thread mewthree19
ok that subject is complex I known I am fairly new to python programming and I 
am using python 3.4.3 and the gui editor/creator boa Constructor and and 
another one what I can't think of as I type this will add later on as am typing 
this of public system and not the computer I do most of my programming on

I have wxPheonix installed for my python version.

I have it layed out like this 

COMBOLIST1 TEXTBOX1 COMBOLIST2 TEXTBOX2 COMBOLIST3
TEXTBOX3
COMBOLIST4 TEXTBOX4

after this I would like to put a button to add more textbox and combolist if 
needed

TEXTBOX5
COMBOLIST5

and then once its done it gets all the information from the textbox and 
combolist and prints it to a RFT/TXT section on the main form of my program

is this possible to do if so how 

if it is not please can you help me work out how to do something that would work

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


Re: I just need this question explained.

2015-06-11 Thread MRAB

On 2015-06-11 13:03, Adebayo Abraham wrote:

I am not requesting for a solution. I just need the question
explained. I am a beginner python developer and i do not know where
to start from to solve this problem. So anybody, somebody: please
explain this question. Am i to create a testcase or create the code
to display a value?


[snip]

You should create a program that will accept test cases and print the
results for each.
--
https://mail.python.org/mailman/listinfo/python-list


Re: Parser needed.

2015-06-11 Thread Larry Martell
On Thu, Jun 11, 2015 at 8:35 AM, Joel Goldstick
joel.goldst...@gmail.com wrote:
 but you aren't asking questions.  You are having a conversation with
 yourself on a public q/a list.  Its unpleasant

Well, he did mention masterbation in another post.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS (update: and NetBSD w/ FFS, Solaris w/ UFS)

2015-06-11 Thread koobs

koobs added the comment:

Hmm, that was supposed to be: issue 24175 and very likely issue 16287

--

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



[issue24430] ZipFile.read() cannot decrypt multiple members from Windows 7zFM

2015-06-11 Thread era

era added the comment:

The call to .setpassword() doesn't seem to make any difference.  I was hoping 
it would offer a workaround, but it didn't.

--

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



I just need this question explained.

2015-06-11 Thread Adebayo Abraham
I am not requesting for a solution. I just need the question explained. I am a 
beginner python developer and i do not know where to start from to solve this 
problem. So anybody, somebody: please explain this question. Am i to create a 
testcase or create the code to display a value?

Challenge: FitFam

Problem

The aerobics class begins. The trainer says, Please position yourselves on the 
training mat so that each one of you has enough space to move your arms around 
freely, and not hit anybody else. People start milling around on the mat, 
trying to position themselves properly. Minutes pass, and finally the trainer 
is so annoyed that he asks you to write a program that will position all the 
people correctly, hoping it will be quicker than letting them figure it out for 
themselves!

You are given the dimensions (width and length) of the mat on which the class 
takes place. For every student, there is a circular area she has to have for 
herself, with radius equal to the reach of her arms. These circles can not 
intersect, though they can touch; and the center of each circle (where the 
student stands) has to be on the mat. Note that the arms can reach outside the 
mat. You know that there's plenty of space on the mat — the area of the mat is 
at least five times larger than the total area of the circles required by all 
the people in the class. It will always be possible for all the people to 
position themselves as required.

Input

The first line of the input gives the number of test cases, T. T test cases 
follow. Each test case consists of two lines. The first line contains three 
integers: N, W and L, denoting the number of students, the width of the mat, 
and the length of the mat, respectively. The second line contains N integers 
ri, denoting the reach of the arms of the ith student.

Output

For each test case, output one line containing Case #n: y, where n is the 
case number (starting from 1) and y is a string containing 2N numbers, each of 
which can be an integer or a real number: x1, y1, x2, y2, etc., where the pair 
(xi, yi) is the position where the ith student should stand (with 0 ≤ xi ≤ W 
and 0 ≤ yi ≤ L).

As there will likely be multiple ways to position the students on the mat, you 
may output any correct positioning; but remember that you may not submit an 
output file more than 200kB in size.

Limits

1 ≤ T ≤ 50.
1 ≤ W, L ≤ 109.
1 ≤ ri ≤ 105.
The area of the mat is at least 5 times larger than the total area of the 
circles:
5*π*(r12 + ... + rN2) ≤ W*L.
Small dataset

1 ≤ N ≤ 10.
Large dataset

1 ≤ N ≤ 103.
The total number of circles in all test cases will be ≤ 6000.
Sample


Input

Output

2
2 6 6
1 1
3 320 2
4 3 2
Case #1: 0.0 0.0 6.0 6.0
Case #2: 0.0 0.0 7.0 0.0 12.0 0.0

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


Re: Parser needed.

2015-06-11 Thread Joel Goldstick
On Thu, Jun 11, 2015 at 7:15 AM, Skybuck Flying skybuck2...@hotmail.com wrote:
 Well it did help a little bit.

 Somebody asked if there was already a parser for it.

 I answered yes in C#.

 So I took a closer look at it... and learned something from it.

 Maybe I would have done that anyway... or maybe not...

 Now we will never know... but I am happy that the parser is now ok, done and
 pretty easy extendable.

 I think it's probably my first really good one.

 I did do a little assembler before... but not sure if it was any good.

 I also read before I started the thread... what parse means in dictionary.

 That also helped me understand it a little bit better.

 And also I read how it's usually done... tokens/tokenize etc... kinda
 already knew that... but still.

 Turned out to be quite easy...

 But at the start /always it seemed so difficult...

 So any little bits of help/advice/information can help ! :)


 Bye,
  Skybuck.
 --
 https://mail.python.org/mailman/listinfo/python-list


but you aren't asking questions.  You are having a conversation with
yourself on a public q/a list.  Its unpleasant
-- 
Joel Goldstick
http://joelgoldstick.com
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue24430] ZipFile.read() cannot decrypt multiple members from Windows 7zfm

2015-06-11 Thread era

New submission from era:

The attached archive from the Windows version of the 7z file manager (7zFM 
version 9.20) cannot be decrypted into memory.  The first file succeeds, but 
the second one fails.

The following small program is able to unzip other encrypted zip archives 
(tried one created by Linux 7z version 9.04 on Debian from the package 
p7zip-full, and one from plain zip 3.0-3 which comes from the InfoZip 
distribution, as well as a number of archives of unknown provenance) but fails 
on the attached one.

from zipfile import ZipFile
from sys import argv

container = ZipFile(argv[1])
for member in container.namelist():
print(member %s % member)
try:
extracted = container.read(member)
print(extracted %s % repr(extracted)[0:64])
except RuntimeError, err:
extracted = container.read(member, 'hello')
container.setpassword('hello')
print(extracted with password 'hello': %s % repr(extracted)[0:64])

Here is the output and backtrace:

member hello/
extracted ''
member hello/goodbye.txt
Traceback (most recent call last):
  File ./nst.py, line 13, in module
extracted = container.read(member, 'hello')
  File /usr/lib/python2.6/zipfile.py, line 834, in read
return self.open(name, r, pwd).read()
  File /usr/lib/python2.6/zipfile.py, line 901, in open
raise RuntimeError(Bad password for file, name)
RuntimeError: ('Bad password for file', 'hello/goodbye.txt')

The 7z command is able to extract it just fine:

$ 7z -phello x /tmp/hello.zip

7-Zip 9.04 beta  Copyright (c) 1999-2009 Igor Pavlov  2009-05-30
p7zip Version 9.04 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,1 CPU)

Processing archive: /tmp/hello.zip

Extracting  hello
Extracting  hello/goodbye.txt
Extracting  hello/hello.txt

Everything is Ok

Folders: 1
Files: 2
Size:   15
Compressed: 560

--
files: hello.zip
messages: 245165
nosy: era
priority: normal
severity: normal
status: open
title: ZipFile.read() cannot decrypt multiple members from Windows 7zfm
Added file: http://bugs.python.org/file39680/hello.zip

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



Re: I just need this question explained.

2015-06-11 Thread David Palao
2015-06-11 14:03 GMT+02:00 Adebayo Abraham adebayo.abra...@gmail.com:
 I am not requesting for a solution. I just need the question explained. I am 
 a beginner python developer and i do not know where to start from to solve 
 this problem. So anybody, somebody: please explain this question. Am i to 
 create a testcase or create the code to display a value?

 Challenge: FitFam

 Problem

 The aerobics class begins. The trainer says, Please position yourselves on 
 the training mat so that each one of you has enough space to move your arms 
 around freely, and not hit anybody else. People start milling around on the 
 mat, trying to position themselves properly. Minutes pass, and finally the 
 trainer is so annoyed that he asks you to write a program that will position 
 all the people correctly, hoping it will be quicker than letting them figure 
 it out for themselves!

 You are given the dimensions (width and length) of the mat on which the class 
 takes place. For every student, there is a circular area she has to have for 
 herself, with radius equal to the reach of her arms. These circles can not 
 intersect, though they can touch; and the center of each circle (where the 
 student stands) has to be on the mat. Note that the arms can reach outside 
 the mat. You know that there's plenty of space on the mat — the area of the 
 mat is at least five times larger than the total area of the circles required 
 by all the people in the class. It will always be possible for all the people 
 to position themselves as required.

 Input

 The first line of the input gives the number of test cases, T. T test cases 
 follow. Each test case consists of two lines. The first line contains three 
 integers: N, W and L, denoting the number of students, the width of the mat, 
 and the length of the mat, respectively. The second line contains N integers 
 ri, denoting the reach of the arms of the ith student.

 Output

 For each test case, output one line containing Case #n: y, where n is the 
 case number (starting from 1) and y is a string containing 2N numbers, each 
 of which can be an integer or a real number: x1, y1, x2, y2, etc., where the 
 pair (xi, yi) is the position where the ith student should stand (with 0 ≤ xi 
 ≤ W and 0 ≤ yi ≤ L).

 As there will likely be multiple ways to position the students on the mat, 
 you may output any correct positioning; but remember that you may not submit 
 an output file more than 200kB in size.

 Limits

 1 ≤ T ≤ 50.
 1 ≤ W, L ≤ 109.
 1 ≤ ri ≤ 105.
 The area of the mat is at least 5 times larger than the total area of the 
 circles:
 5*π*(r12 + ... + rN2) ≤ W*L.
 Small dataset

 1 ≤ N ≤ 10.
 Large dataset

 1 ≤ N ≤ 103.
 The total number of circles in all test cases will be ≤ 6000.
 Sample


 Input

 Output

 2
 2 6 6
 1 1
 3 320 2
 4 3 2
 Case #1: 0.0 0.0 6.0 6.0
 Case #2: 0.0 0.0 7.0 0.0 12.0 0.0

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

Hello again,
It looks to me that you have to write the code that is able to read
the input described and produce the wished output.
You could organize the program like
1) read input
2) compute
3) print out result
Perhaps each part being a function.

Try something and tell us when you are blocked.

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


[issue24430] ZipFile.read() cannot decrypt multiple members from Windows 7zFM

2015-06-11 Thread era

Changes by era era+pyt...@iki.fi:


--
components: +Library (Lib)
title: ZipFile.read() cannot decrypt multiple members from Windows 7zfm - 
ZipFile.read() cannot decrypt multiple members from Windows 7zFM
type:  - behavior

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



[issue24330] Idle doc: explain Configure Idle not in Options on OSX, etc.

2015-06-11 Thread André Freitas

André Freitas added the comment:

I have added the explanation in the Docs and IDLE help file. Found also that 
IDLE help.txt is out of sync with the Docs and needs to be fixed. I will open a 
new Issue.

--
keywords: +patch
nosy: +André Freitas
Added file: http://bugs.python.org/file39686/patch.diff

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



[issue24429] msvcrt error when embedded

2015-06-11 Thread Steve Dower

Steve Dower added the comment:

Python needs to be recompiled to use a different CRT, and that will break all 
existing extension modules (.pyd's). That said, in some situations it is the 
right answer, typically because existing extension modules would be broken 
anyway, but I don't think that applies here.

To load msvcr90.dll, you need to declare in your executable which version you 
want to use using a manifest. This enables side-by-side use of the CRT, so 
different programs can use different versions and they are all managed by the 
operating system (for security fixes, etc.). Otherwise, you get hundreds of 
copies of the CRT and they are likely to be lacking the latest patches.

A way to hack in the manifest is to put it alongside the executable. You could 
take the file from 
http://stackoverflow.com/questions/27389227/how-do-i-load-a-c-dll-from-the-sxs-in-python/27392347#27392347
 and put it alongside the MATLAB executable as matlab.exe.manifest or 
whatever, which avoids having to get Mathworks involved, and that might allow 
you to load msvcr90.dll. If they've already embedded a manifest into the 
executable (which is very likely), then I don't know which one will win or what 
effects may occur if the original one is ignored.

--

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



[issue24429] msvcrt error when embedded

2015-06-11 Thread erik flister

erik flister added the comment:

 it would be better for MATLAB to embed the manifest in their host executable 
 if they're going to load the DLL directly.

can you help me understand?  as far as i could tell, we need python to use the 
msvcr*.dll that comes with matlab, not v/v.

it's hard (as a customer) to get mathworks (matlab's author) to do anything, 
but if the fix would best be done by them, they might listen to official 
python muckity-mucks, especially since their python integration is relatively 
new...  no idea how to find out who to contact there though.

--

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



[issue24436] _PyTraceback_Add has no const qualifier for its char * arguments

2015-06-11 Thread Michael Ensslin

New submission from Michael Ensslin:

The prototype for the public API function _PyTraceback_Add is declared

_PyTraceback_Add(char *, char *, int);

Internally, its char * arguments are passed verbatim to PyCode_NewEmpty, which 
takes const char * arguments.

The missing 'const' qualifier for the arguments of _PyTraceback_Add thus serves 
no purpose, and means that C++ code can't invoke the method with const char * 
arguments.

I've attached a proposed patch.

I can't think of any negative consequences from adding the 'const' qualifier 
(famous last words).

--
components: Interpreter Core
files: const.patch
keywords: patch
messages: 245185
nosy: mic-e
priority: normal
severity: normal
status: open
title: _PyTraceback_Add has no const qualifier for its char * arguments
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file39685/const.patch

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



[issue24436] _PyTraceback_Add has no const qualifier for its char * arguments

2015-06-11 Thread Michael Ensslin

Changes by Michael Ensslin michael.enss...@googlemail.com:


--
type:  - enhancement

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



Re: How to pretty mathematical formulas in Python? Similar to Mathematica formats.

2015-06-11 Thread TheSeeker
On Thursday, June 11, 2015 at 1:33:12 PM UTC-5, Sebastian M Cheung wrote:
 How to pretty mathematical formulas in Python? Similar to Mathematica formats.
 
 Are there good packages to prettify mathematica formulas in Python?

Sympy (http://www.sympy.org/en/index.html) has some capabilities to 
pretty-print mathematics.

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


[issue24437] Add information about the buildbot console view and irc notices to devguide

2015-06-11 Thread R. David Murray

New submission from R. David Murray:

Here is a proposed addition to the devguide talking about the buildbot console 
interface (which I find far more useful than the waterfall view), and 
mentioning the notifications posted to #python-dev (which is a good way to find 
out if you broke the buildbots).

--
components: Devguide
files: buildbot-console-irc.patch
keywords: patch
messages: 245190
nosy: ezio.melotti, ncoghlan, r.david.murray, willingc
priority: normal
severity: normal
stage: patch review
status: open
title: Add information about the buildbot console view and irc notices to 
devguide
Added file: http://bugs.python.org/file39687/buildbot-console-irc.patch

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



[issue24429] msvcrt error when embedded

2015-06-11 Thread erik flister

erik flister added the comment:

thanks - i still don't understand tho.  if python would have to be recompiled 
to use a different crt, why wouldn't matlab?  if a manifest could fix matlab, 
why couldn't one fix python?

i ran into all this trying to get shapely to load in matlab, and using msvcrt 
instead of find_library('c') solved it there:
https://github.com/Toblerity/Shapely/issues/104#issuecomment-111050335

that solution seems so much easier than any of this manifest/sxs stuff -- but 
you're saying it's wrong?

sorry i'm slow, never dealt with any of this stuff before...

--

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



XCode and Python

2015-06-11 Thread Sebastian M Cheung via Python-list
For some reason I cannot build now in XCode:

$ xcodebuild -find python
/Users/sebc/anaconda/bin/python

$python
Python 2.7.10 |Anaconda 2.2.0 (x86_64)| (default, May 28 2015, 17:04:42) 
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type help, copyright, credits or license for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org

But XCode now simply say error

env: python: No such file or directory
Command 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
 failed with exit code 127

I couldn't find anything relating XCode for iPhone related to Python build? I 
am using
anaconda Python

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


[issue24429] msvcrt error when embedded

2015-06-11 Thread Steve Dower

Steve Dower added the comment:

python.exe already has the manifest it needs, but it can't be embedded into 
python27.dll - it has to go into the exe file. That's why Python can't make it 
so that msvcr90.dll is loaded.

Depending on what you're using it for, the C Runtime may keep some state in 
between function calls. For things like string copying (with no locale) you'll 
be okay, but most of the complication stuff assumes that every call into the 
CRT is calling into the *same* CRT. When you load different CRTs at the same 
time (as is happening here already, or when you load mscvrt.dll directly), you 
have to be very careful not to intermix them together at all.

The most obvious example is open file handles. If you open a file with CRT 9.0 
(msvcr90.dll) and then try and read from it with CRT 6.0 (msvcrt.dll), you'll 
probably crash or at least corrupt something. The same goes for memory 
allocations - if CRT 9.0 does a malloc() and then CRT 10.0 does the free(), 
you're almost certainly going to corrupt something because they are not 
compatible.

I suspect Mathworks is relying on people installing Python themselves so they 
don't have to redistribute it as part of MATLAB, which is totally fine, but you 
have to be prepared to deal with this situation. If they make their own build, 
they need to distribute it themselves (easy) and explain to people why numpy 
doesn't work anymore unless you use their special build of numpy too (ie. 
because it uses a different CRT).

Like I said initially, we would probably accept a patch for uuid.py to skip the 
CRT scan on Windows, and similar changes like that where appropriate. If you 
need to be able to load the DLL yourself, you either need to carefully consider 
how the functions you call may interact with other implementations/versions 
that may be loaded, or set up the manifest so you can load msvcr90.dll.

--

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



[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS (update: and NetBSD w/ FFS, Solaris w/ UFS)

2015-06-11 Thread STINNER Victor

STINNER Victor added the comment:

The resolution of os.utime()+os.stat() depends on two things:

- resolution of the timestamp on the filesystem used to run test_os (where 
TESTFN is written)
- resolution of the C internal function used by os.utime()

os.utime() can have a resolution of 1 ns (ex: it's usually the case on Linux), 
whereas the FAT filesystem has as resolution of 2 seconds.

os.utime() can have a resolution of 1 us (ex: FreeBSD) whereas the ZFS 
filesystem has a resolution of 1 ns.

Currently, test_os.test_*utime*_ns checks that os.utime() is able to copy the 
timestamp of a file 1 to a file 2. Problem: we don't know the resolution of the 
timestamp of the file 2. We can get the resolution of the C internal function 
used by os.utime(). It is implemented in the attached test_os.patch. But it's 
much more complex to get the timestamp resolution of the filesystem, in a 
portable way.

Random thoughts:

* use a timestamp with a resolution of 1 us, smaller than 2^24 to avoid 
rounding issues. Example: (atime=1.002003, mtime=4.005006)?

* compute the effective utime resolution: call os.utime() with a well known 
timestamp with a resolution of 1 nanosecond (smaller than 2^24 to avoid 
rounding issues) and call os.stat() to check which digits were preserved

test_os must not depend too much on the filesystem. I don't think that we 
should implement complex code just to check a simple field in the 
os.stat_result structure. The first idea (call utime with a fixed number, don't 
rely on an unknown file timestamp) is probably enough.

--

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



[issue24429] msvcrt error when embedded

2015-06-11 Thread Steve Dower

Steve Dower added the comment:

Ah, it can go into the DLL, and it's already there. The problem may be that 
there is conflicting information about which resource ID - 
https://msdn.microsoft.com/en-us/library/aa374224(v=vs.90).aspx says it should 
be 1 while your link says 2.

python27.dll has the manifest as resource 2, so if that is incorrect, then that 
could be a reason why it's not working. (Looking at the search paths in that 
link above, there are other potential reasons if it's finding a compatible 
assembly in the MATLAB folder, but it sounds like that's not the case.)

I guess we need someone with the patience to go through and figure out exactly 
whether it should be 1 or 2. That person is not me, sorry.

--

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



Re: XCode and Python

2015-06-11 Thread Sebastian M Cheung via Python-list
On Thursday, June 11, 2015 at 11:07:59 PM UTC+1, Sebastian M Cheung wrote:
 For some reason I cannot build now in XCode:
 
 $ xcodebuild -find python
 /Users/sebc/anaconda/bin/python
 
 $python
 Python 2.7.10 |Anaconda 2.2.0 (x86_64)| (default, May 28 2015, 17:04:42) 
 [GCC 4.2.1 (Apple Inc. build 5577)] on darwin
 Type help, copyright, credits or license for more information.
 Anaconda is brought to you by Continuum Analytics.
 Please check out: http://continuum.io/thanks and https://binstar.org
 
 But XCode now simply say error
 
 env: python: No such file or directory
 Command 
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
  failed with exit code 127
 
 I couldn't find anything relating XCode for iPhone related to Python build? I 
 am using
 anaconda Python
 
 Anyone?

Or I need to configure something in Xcode?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue24429] msvcrt error when embedded

2015-06-11 Thread erik flister

erik flister added the comment:

if it can't go into your .dll, what are libraries like shapely supposed to do?  
tell their users to do all this manifest stuff if they're running embedded?

--

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



[issue24429] msvcrt error when embedded

2015-06-11 Thread erik flister

erik flister added the comment:

relevant: 
http://stackoverflow.com/questions/30771380/how-use-ctypes-with-msvc-dll-from-within-matlab-on-windows/#comment49619037_30771380

--

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



[issue24436] _PyTraceback_Add has no const qualifier for its char * arguments

2015-06-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--
nosy: +Mark.Shannon, pitrou, serhiy.storchaka
stage:  - commit review

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



Re: How to pretty mathematical formulas in Python? Similar to Mathematica formats.

2015-06-11 Thread Sebastian M Cheung via Python-list
On Thursday, June 11, 2015 at 7:33:12 PM UTC+1, Sebastian M Cheung wrote:
 How to pretty mathematical formulas in Python? Similar to Mathematica formats.
 
 Are there good packages to prettify mathematica formulas in Python?

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


[issue24429] msvcrt error when embedded

2015-06-11 Thread erik flister

erik flister added the comment:

am i reading this wrong, that you can put the manifest into the .dll?
https://msdn.microsoft.com/en-us/library/ms235560(v=vs.90).aspx

--

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



Re: XCode and Python

2015-06-11 Thread C.D. Reimer

On 6/11/2015 3:09 PM, Sebastian M Cheung via Python-list wrote:
Or I need to configure something in Xcode? 


Perhaps this link might help determine if the problem is with Xcode 
and/or Python.


http://stackoverflow.com/questions/5276967/python-in-xcode-6

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


[issue24426] re.split performance degraded significantly by capturing group

2015-06-11 Thread Patrick Maupin

Patrick Maupin added the comment:

Thank you for the quick response, Serhiy.  I had started investigating and come 
to the conclusion that it was a problem with the compiler rather than the C 
engine.  Interestingly, my next step was going to be to use names for the 
compiler constants, and then I noticed you did that exact same thing in the 3.6 
tree.

I will try this out on my use-case tomorrow to make sure it fixes my issue, but 
now I'm intrigued by the inner workings of this, so I have two questions:

1) Do you know if anybody maintains a patched version of the Python code 
anywhere?  I could put a package up on github/PyPI, if not.

2) Do you know if anybody has done a good writeup on the behavior of the 
instruction stream to the C engine?  I could try to do some work on this and 
put it with the package, if not, or point to it if so.

Thanks and best regards,
Pat

--

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



[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS (update: and NetBSD w/ FFS, Solaris w/ UFS)

2015-06-11 Thread STINNER Victor

STINNER Victor added the comment:

test_utime_ns.patch: rewrite _test_utime_ns(). It now uses constant timestamps 
for atime and mtime with a resolution of 1 us.

The test will fail if the internal function of os.utime() has a resolution of 1 
sec (utime() with time_t) of if the resolution of filesystem timestamp is worse 
than 1 us.

In practice on buildbots, it looks like the effective resolution of 1 us 
(FreeBSD, Solaris), 100 ns (Windows) or 1 ns (Linux). So 1 us should work on 
all buildbot slaves.

test_utime_ns.patch doesn't call os.utime() on directories, only on a regular 
file. I don't understand the purpose of testing with a directory. Are we 
testing the OS or Python?

--
Added file: http://bugs.python.org/file39688/test_utime_ns.patch

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



[issue24434] ItemsView.__contains__ does not mimic dict_items

2015-06-11 Thread Martin Panter

Martin Panter added the comment:

Added a couple suggestions for the test case on Reitveld.

--
nosy: +vadmium
stage:  - patch review

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



[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS (update: and NetBSD w/ FFS, Solaris w/ UFS)

2015-06-11 Thread STINNER Victor

STINNER Victor added the comment:

almostequaltime.diff is wrong: it allows a different of 10 seconds, whereas the 
issue is a difference of less than 1000 nanoseconds.

test_os.patch looks more correct, but I didn't review the patch.

--

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



[issue24400] Awaitable ABC incompatible with functools.singledispatch

2015-06-11 Thread Nick Coghlan

Nick Coghlan added the comment:

Low level review sent.

Regarding the new opcode, it appears the main thing it provides is early 
detection of yielding from a coroutine in a normal generator, which is never 
going to work properly (a for loop or other iterative construct can't drive a 
coroutine as it expects to be driven), but would be incredibly painful to debug 
if you did it accidentally.

For me, that counts as a good enough reason to add a new opcode during the beta 
period (just as adding the new types is necessary to fix various problems with 
the original not-actually-a-different-type implementation).

--

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



[issue24434] ItemsView.__contains__ does not mimic dict_items

2015-06-11 Thread Caleb Levy

Caleb Levy added the comment:

@serhiy.storchaka: I don't think that will work.

First of all,

x, y = item

will raise a ValueError if fed an iterable whose length is not exactly 2, so 
you would have to check for that. Moreover, if item is something like a dict, 
for example, then:

{a: 1, b: 2} in DictLikeMapping(a=b)

could return True, which I don't think would be expected behavior.

I'm not terribly fond of the instance check myself, but in this case I can't 
see any other way to do it: the built in dict_items necessarily consists of 
*tuples* of key-value pairs.

--

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



[issue24434] ItemsView.__contains__ does not mimic dict_items

2015-06-11 Thread Caleb Levy

Caleb Levy added the comment:

Sorry; that should be DictLikeMapping(a=b).items(), where DictLikeMapping is 
defined in the patch unit tests.

--

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



[issue23996] _PyGen_FetchStopIterationValue() crashes on unnormalised exceptions

2015-06-11 Thread Stefan Behnel

Changes by Stefan Behnel sco...@users.sourceforge.net:


Added file: http://bugs.python.org/file39692/fix_stopiteration_value.patch

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



[issue23996] _PyGen_FetchStopIterationValue() crashes on unnormalised exceptions

2015-06-11 Thread Stefan Behnel

Stefan Behnel added the comment:

Here are two patches that fix this case, one with special casing, one without. 
Please choose and apply one.

--
Added file: http://bugs.python.org/file39691/fix_stopiteration_value_slow.patch

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



[issue23760] Tkinter in Python 3.4 on Windows don't post internal clipboard data to the Windows clipboard on exit

2015-06-11 Thread Martin Panter

Changes by Martin Panter vadmium...@gmail.com:


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware -vadmium

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



[issue23760] Tkinter in Python 3.4 on Windows don't post internal clipboard data to the Windows clipboard on exit

2015-06-11 Thread Zachary Ware

Zachary Ware added the comment:

I don't believe there's anything Python can do about this, unless it can be 
confirmed that this is a bug that's been fixed in a more recent version of 
Tcl/Tk 8.6, in which case we can update our dependency.  The easy test for 
whether updating Tcl/Tk in 3.4 (which uses 8.6.1) will do any good is to try 
this out with 3.5.0b2 (which uses the latest 8.6.4).

--
resolution:  - third party
status: open - pending

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



[issue24434] ItemsView.__contains__ does not mimic dict_items

2015-06-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Additional check hits performance. First issue can be resolved by changing code 
to

try:
key, value = item
except TypeError:
return False

Second issue can be resolved by comparing not v with value, but (key, v) with 
item. However I'm not sure that fixing it is worth such complication of the 
code.

--
nosy: +serhiy.storchaka
versions:  -Python 3.2, Python 3.3

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



[issue24437] Add information about the buildbot console view and irc notices to devguide

2015-06-11 Thread Zachary Ware

Zachary Ware added the comment:

Due to lack of Rietveld, comments in-line (? lines) below:



@@ -42,6 +42,24 @@
 
   bbreport.py -q 3.x
 
+* The buildbot console interface at http://buildbot.python.org/all/console
+  (this link will take a while to load), which provides a summary view of all

? I think it can be assumed that most pages from buildbot.python.org will be 
slow to load :)
? Perhaps add that comment in the 'The Web interface...' paragraph above?

+  builders and all branches.  This works best on a wide, high resolution
+  monitor.  You can enter the your mercurial username (your name

? s/the your/your/

+  your@email) in the 'personalized for' box in the upper right corner to see
+  the results just for changesets submitted by you.  Clicking on the colored
+  circles will allow you to open a new page containing whatever information
+  about that particular build is of interest to you.  You can also access
+  builder information by clicking on the builder status bubbles in the top
+  line.
+
+If you like IRC, having an irc client open to the #python-dev channel on

? Should 'irc' be capitalized?

+irc.freenode.net is useful.  If a build fails (and the previous build by the
+same builder did not) then a message is posted to the channel.  Likewise if a
+build passes when the previous one did not, a message is posted.  Keeping an

? I think this could be simplified to 'Any time a builder switches from passing
? to failing (or vice versa), a message is posted to the channel.'

? 'switches from passing to failing' is still a bit iffy, though. Maybe 
? 'fails a build after a successful build'?  Or a simpler 'switches from green 
to red'?
? That could be construed as color-blind-ist, though :)

+eye on the channel after pushing a changeset is a simple way to get notified
+that there is something you should look in to.
+
 Some buildbots are much faster than others.  Over time, you will learn which
 ones produce the quickest results after a build, and which ones take the
 longest time.



I had not used the console view before, that's pretty nice!

--
nosy: +zach.ware

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



[issue24175] Consistent test_utime() failures on FreeBSD

2015-06-11 Thread Zachary Ware

Changes by Zachary Ware zachary.w...@gmail.com:


--
nosy: +zach.ware

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



[issue24303] OSError 17 due to _multiprocessing/semaphore.c assuming a one-to-one Pid - process mapping.

2015-06-11 Thread Charles-François Natali

Charles-François Natali added the comment:

Here's a patch against 2.7 using _PyOS_URandom(): it should apply as-is to 3.3.

--
keywords: +patch
nosy: +neologix
versions: +Python 3.3
Added file: http://bugs.python.org/file39679/mp_sem_race.diff

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



Re: New Python student needs help with execution

2015-06-11 Thread Mark Lawrence

On 11/06/2015 05:50, c me wrote:

I installed 2.7.9 on a Win8.1 machine. The Coursera instructor did a simple 
install then executed Python from a file in which he'd put a simple hello world 
script.  My similar documents folder cannot see the python executable.  How do 
I make this work?



I'm not sure what you're asking but this 
https://docs.python.org/3/using/windows.html should help.


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


[issue24307] pip error on windows whose current user name contains non-ascii characters

2015-06-11 Thread Suzumizaki

Changes by Suzumizaki suzumiz...@free.japandesign.ne.jp:


--
nosy: +Suzumizaki

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



[issue23391] Documentation of EnvironmentError (OSError) arguments disappeared

2015-06-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It should be documented (if still not) that OSError() constructor can return an 
instance of OSError subclass, depending on errno value.

 OSError(errno.ENOENT, 'no such file')
FileNotFoundError(2, 'no such file')

--

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



[issue23391] Documentation of EnvironmentError (OSError) arguments disappeared

2015-06-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +r.david.murray

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



[issue24420] Documentation regressions from adding subprocess.run()

2015-06-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +serhiy.storchaka

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



[issue24434] ItemsView.__contains__ does not mimic dict_items

2015-06-11 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
assignee:  - rhettinger

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



[issue11245] Implementation of IMAP IDLE in imaplib?

2015-06-11 Thread R. David Murray

R. David Murray added the comment:

Are you volunteering to be maintainer, and/or is Piers?  If he's changed his 
mind about the threading, that's good enough for me (and by now he has a lot 
more experience with the library in actual use).

The biggest barrier to inclusion, IMO, is tests and backward compatibility.  
There have been enough changes that making sure we don't break backward 
compatibility will be important, and almost certainly requires more tests than 
we have now.  Does imaplib2 have a test suite?

We would need to get approval from python-dev, though.  We have ongoing 
problems with packages that are maintained outside the stdlib...but updating to 
imaplib2 may be better than leaving it without a maintainer at all.

Can we get Piers involved in this conversation directly?

--
versions: +Python 3.6 -Python 3.4

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



[issue19176] DeprecationWarning for doctype() method when subclassing _elementtree.XMLParser

2015-06-11 Thread Martin Panter

Martin Panter added the comment:

Ideally I guess the Python native behaviour is better: only call 
target.doctype() if available. It might allow you to easily implement doctype() 
in both the old and new versions of the API, without worrying about the API 
being called twice, and without experiencing any DeprecationWarning. But I do 
not have a real-world use case to demonstrate this, and I don’t think this 
decision should hold up committing inherit-doctype.v2.patch. They are separate 
bugs.

BTW: Another difference between the implementations is that the C version 
accepts my !DOCTYPE blaua test case, but the Python version ignores it. It 
only works with a more elaborate case like !DOCTYPE blaua SYSTEM dtd. I’m 
no expert, but I think my original XML should be allowed.

--

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



[issue19176] DeprecationWarning for doctype() method when subclassing _elementtree.XMLParser

2015-06-11 Thread Martin Panter

Changes by Martin Panter vadmium...@gmail.com:


--
components: +Extension Modules

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



[issue19176] DeprecationWarning for doctype() method when subclassing _elementtree.XMLParser

2015-06-11 Thread Martin Panter

Changes by Martin Panter vadmium...@gmail.com:


--
components: +XML -Extension Modules

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



[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS (update: and NetBSD w/ FFS, Solaris w/ UFS)

2015-06-11 Thread STINNER Victor

STINNER Victor added the comment:

test_utime.patch: a much larger patch which rewrites all unit tests on 
os.utime().

Changes:

* Use a fixed timestamp instead of copying timestamps from an existing file. If 
the timestamp of the original file can have a resolution of 1 nanosecond, 
os.utime() rounds to a resolution of 1 us on some platforms (when the C 
function uses a structure with a resolutionf of 1 us).
* Use a fixed timestamp with a resolution of 1 us instead of a resolution of 1 
ms.
* Remove test_1565150(): it's now redundant with test_utime() and many other 
test_utime_*() tests
* Use self.fname instead of __file__ to check if the filesystem supports 
subsecond resolution: these two files may be in two different filesystems
* test_large_time() now checks the filesystem when it is executed, not when the 
class is defined. This change is to ensure that we are testing the right 
filesystem.
* replace support.TESTFN with self.dirname for readability
* move all os.utime() tests in a new dedicated class
* _test_utime_current() now get the system clock using time.time() and tolerate 
a delta of 10 ms instead of 10 seconds: we may increase the delta because of 
slow buildbots, but I hope that we can find a value smaller than 10 seconds!
* Avoid tricky getattr(), it's no more needed
* Merge duplicated test_utime_*() and test_utime_subsecond_*() functions
* Test also st_atime on when testing os.utime() on a directory
* etc.

--
Added file: http://bugs.python.org/file39689/test_utime.patch

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



[issue23391] Documentation of EnvironmentError (OSError) arguments disappeared

2015-06-11 Thread Martin Panter

Martin Panter added the comment:

New patch, clarifying that the constructor can raise a subclass.

If you still think I need to add something about extra arguments, or how the 
“args” attribute is set, let me know.

--
Added file: http://bugs.python.org/file39690/os-error-args.v3.patch

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



Re: Did the 3.4.4 docs get published early?

2015-06-11 Thread Nicholas Chammas
Sorry, somehow the formatting in my previous email didn't come through
correctly.

This part was supposed to be in a quote block:

 Also, just replacing the version number in the URL works for the python 3
series
 (use 3.X even for python 3.0), even farther back than the drop down menu
allows.

Nick

On Wed, Jun 10, 2015 at 2:25 PM Nicholas Chammas nicholas.cham...@gmail.com
wrote:

 Also, just replacing the version number in the URL works for the python 3
 series (use 3.X even for python 3.0), even farther back than the drop down
 menu allows.

 This does not help in this case:

 https://docs.python.org/3.4/library/asyncio-task.html#asyncio.ensure_future

 Also, you cannot select the docs for a maintenance release, like 3.4.3.

 Anyway, it’s not a big deal as long as significant changes are tagged
 appropriately with notes like “New in version NNN”, which they are.

 Ideally, the docs would only show the latest changes for released versions
 of Python, but since some changes (like the one I linked to) are introduced
 in maintenance versions, it’s probably hard to separate them out into
 separate branches.

 Nick
 ​

 On Wed, Jun 10, 2015 at 10:11 AM Nicholas Chammas 
 nicholas.cham...@gmail.com wrote:

 For example, here is a New in version 3.4.4 method:

 https://docs.python.org/3/library/asyncio-task.html#asyncio.ensure_future

 However, the latest release appears to be 3.4.3:

 https://www.python.org/downloads/

 Is this normal, or did the 3.4.4 docs somehow get published early by
 mistake?

 Nick


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


[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS (update: and NetBSD w/ FFS, Solaris w/ UFS)

2015-06-11 Thread koobs

koobs added the comment:

Can a test be made to show a message (similar to a skipIf reason=) mentioning 
that a reduced precision is being used for certain tests?

It would be nice not to have to remember this issue as platform support changes 
(reads: improves) over time.

Not withstanding, it's also apparent that there may be an underlying rounding 
bug or race condition that ultimately causes some of the assertions in this 
tests to be false, which is the premise behind Harrisons assertAlmostEqual 
patch (matching other tests)

--

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



Re: I don't like the OO part of python. In particular the self keyword everywhere.

2015-06-11 Thread Thomas Mlynarczyk

On 11/06/15 14:16, MRAB wrote:

harder then they anticipated.

---^

seems nicer... then having to use self everywhere...


then? Should be than... (That seems to be happening more and more
these days...)


Indeed :-)

--
Ce n'est pas parce qu'ils sont nombreux à avoir tort qu'ils ont raison!
(Coluche)
--
https://mail.python.org/mailman/listinfo/python-list


Re: Parser needed.

2015-06-11 Thread Rustom Mody
On Thursday, June 11, 2015 at 6:08:22 PM UTC+5:30, larry@gmail.com wrote:
 On Thu, Jun 11, 2015 at 8:35 AM, Joel Goldstick wrote:
  but you aren't asking questions.  You are having a conversation with
  yourself on a public q/a list.  Its unpleasant
 
 Well, he did mention masterbation in another post.

Er...

Those of us who happen to be teachers are getting pointed at by the 
misspelling+archaism combo above.

Thought python had no rogue pointers? wink
-- 
https://mail.python.org/mailman/listinfo/python-list


Error in or

2015-06-11 Thread subhabrata . banerji
Dear Group,

In the following script,

  inp1=raw_input(PRINT YOUR INPUT:)
  if (AND in inp1) or (OR in inp1) or (NOT in inp1) or ( in inp1) or 
( in inp1) or (MAYBE in inp1) or (( in inp1) or (* in inp1):
  
  if write this it is working fine, but if I write 
   
  if (AND in inp1) or (OR in inp1) or (NOT in inp1) or ( in inp1) or 
( in inp1) or (MAYBE in inp1) or (( in inp1) or (* in inp1) or ('''  
''' in   inp1):
  
 the portion of ('''  ''' in   inp1) is not working.

If any one of the esteemed members may kindly suggest the error I am making.

I am using Python2.7+ on Windows 7 Professional. 

Apology for any indentation error. 

Regards,
Subhabrata Banerjee. 
 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: New Python student needs help with execution

2015-06-11 Thread Laura Creighton
In a message of Thu, 11 Jun 2015 16:03:33 +0200, Chris Warrick writes:
On Thu, Jun 11, 2015 at 10:52 AM, Laura Creighton l...@openend.se wrote:
 In a message of Wed, 10 Jun 2015 21:50:54 -0700, c me writes:
I installed 2.7.9 on a Win8.1 machine. The Coursera instructor did a simple 
install then executed Python from a file in which he'd put a simple hello 
world script.  My similar documents folder cannot see the python executable. 
 How do I make this work?
--
https://mail.python.org/mailman/listinfo/python-list

 You need to set your PYTHONPATH.
 Instructions here should help.
 https://docs.python.org/2.7/using/windows.html

 It is possible that you need to do some other things too, but again
 that's the doc for it.

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

It’s actually %PATH%. %PYTHONPATH% does something different and is not
really useful to newcomers (especially since there are much better
ways to accomplish what it does)

-- 
Chris Warrick https://chriswarrick.com/
PGP: 5EAAEA16

Sorry about that -- what you get for not using windows.  Thank you.

Laura

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


Re: Error in or

2015-06-11 Thread Ian Kelly
On Thu, Jun 11, 2015 at 9:40 AM,  subhabrata.bane...@gmail.com wrote:
   if write this it is working fine, but if I write

   if (AND in inp1) or (OR in inp1) or (NOT in inp1) or ( in inp1) or 
 ( in inp1) or (MAYBE in inp1) or (( in inp1) or (* in inp1) or (''' 
  ''' in   inp1):

  the portion of ('''  ''' in   inp1) is not working.

Not working how? I copy-pasted the line and it appears to work fine.
-- 
https://mail.python.org/mailman/listinfo/python-list


  1   2   >