[issue31500] IDLE: Tiny font on HiDPI display

2017-09-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If just negate the size the menu and the dialog fonts look like on a display 
with 72 DPI. But currently monitors rarely have such DPI. Normal displays have 
about 100 DPI (scaling factor about 1.33). If we want to keep font sizes on 
such displays we should multiply sizes by 0.75 for converting from pixels to 
points.

--

___
Python tracker 

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



[issue31351] ensurepip discards pip's return code which leads to broken venvs

2017-09-19 Thread Martin Vielsmaier

Martin Vielsmaier added the comment:

I guess this is also the root cause for the problem I reported on virtualenv: 
https://github.com/pypa/virtualenv/issues/1074

--
nosy: +Martin Vielsmaier

___
Python tracker 

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



Re: Old Man Yells At Cloud

2017-09-19 Thread Chris Angelico
On Wed, Sep 20, 2017 at 2:55 PM, Pavol Lisy  wrote:
> BTW if python would only bring "from __cleverness__ import
> print_function" how many people would accept your reasons and use it?
> And how many would rewrite old code?
>
> How many people would say something like: "Oh it is cool! Now I could
> rewrite my old code and monkey patch print!" ?

Cool thing is that now that 'print' isn't a keyword, you can actually
write that as:

from cleverness import print

and put whatever functionality you like into cleverness.py. The only
thing you *can't* do that way is mess with syntax - and if you want to
prototype a change to syntax, you can play with MacroPy. So you can
actually publish something and ask people to try using it.

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


Issues with python commands in windows powershell

2017-09-19 Thread Joey Steward
Hello,

I've been having issues using basic python commands in windows powershell.
I'm new to programming so just going off of online tutorials.

Earlier I was unable to use pip to install Django (pip install Django), and
came to this forum for help and someone was able to give me the correct
command for windows 10 (py -m pip install django).

I've been trying to run this command django-admin startproject mytests, but
get the same error message as when trying to run the original pip

django-admin : *The term 'django-admin' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included,*
*verify that the path is correct and try again.*
*At line:1 char:1*
+ django-admin startproject mytestsite
+ 
+ CategoryInfo  : ObjectNotFound: (django-admin:String) [],
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException


I'm very new so honestly have no idea what the issue may be, but from
previously trying to use python I think it may have something to do with
configuring windows environment variables? Not sure, but just something
I've ran into in the past previous times trying to learn python for more
data analysis purposes.

Any help would be greatly appreciated!

Thanks a lot,

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


[issue31506] Improve the error message logic for object_new & object_init

2017-09-19 Thread Nick Coghlan

Nick Coghlan added the comment:

I filed issue 31527 as a follow-up issue to see whether or not it might be 
possible to amend the way these custom errors are generated to benefit from the 
work that has gone into improving the error responses from 
PyArg_ParseTupleAndKeywords.

--

___
Python tracker 

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



[issue31527] Report details of excess arguments in object_new & object_init

2017-09-19 Thread Nick Coghlan

Nick Coghlan added the comment:

Adding a dependency on issue 31506, as this shouldn't be tackled until those 
simpler amendments are resolved.

--
dependencies: +Improve the error message logic for object_new & object_init

___
Python tracker 

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



[issue31527] Report details of excess arguments in object_new & object_init

2017-09-19 Thread Nick Coghlan

New submission from Nick Coghlan:

object_new and object_init currently use their own argument checking logic, and 
hence haven't benefited from the error reporting enhancements in 
PyArg_ParseTupleAndKeywords

Compare:

>>> str(1, 2, 3, 4, 5, x=1)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: str() takes at most 3 arguments (6 given)
>>> str(x=1)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'x' is an invalid keyword argument for this function

To:

>>> C(1, 2, 3, 4)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: object() takes no parameters
>>> C(x=1)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: object() takes no parameters

Issue 31506 amends the latter to at least report the subclass name rather than 
the base class name, but doesn't cover any other enhancements, like reporting 
how many arguments were actually given, or the first unknown keyword argument 
name.

--
messages: 302591
nosy: ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Report details of excess arguments in object_new & object_init
type: enhancement

___
Python tracker 

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



[issue31526] Allow setting timestamp in gzip-compressed tarfiles

2017-09-19 Thread Jack Lloyd

New submission from Jack Lloyd:

Context: I have a script which checks out a software release (tagged git 
revision) and builds an archive to distribute to end users. One goal of this 
script is that the archive is reproducible, ie if the script is run twice (at 
different times, on different machines, by different people) it produces 
bit-for-bit identical output, and thus also has the same SHA-256 hash.

Mostly this works great, using the TarInfo feature of tarfile.py to set the 
uid/gid/mtime to fixed values. Except I also want to compress the archive, and 
tarfile calls time.time() to find out the timestamp that will be embedded in 
the gzip header. This breaks my carefully deterministic output.

I would like it if tarfile accepted an additional keyword that allowed 
overriding the time value for the gzip header. As it is I just hack around it 
with

def null_time():
return 0
time.time = null_time

which does work but is also horrible.

Alternately, tarfile could just always set the timestamp header to 0 and avoid 
having its output depend on the current clock. I doubt anyone would notice.

The script in question is here 
https://github.com/randombit/botan/blob/master/src/scripts/dist.py

My script uses Python2 for various reasons, but it seems the same problem 
affects even the tarfile.py in latest Python3. I would be willing to try 
writing a patch for this, if anything along these lines might be accepted.

Thanks.

--
components: Library (Lib)
messages: 302590
nosy: randombit
priority: normal
severity: normal
status: open
title: Allow setting timestamp in gzip-compressed tarfiles
type: enhancement
versions: Python 3.7

___
Python tracker 

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



Re: [RELEASE] Python 3.6.3rc1 and 3.7.0a1 are now available for testing and more

2017-09-19 Thread Paul Rubin
Ned Deily  writes:
> You can find Python 3.7.0a1 and more information here:
> https://www.python.org/downloads/release/python-370a1/

This says:

The next pre-release of Python 3.7 will be 3.6.0a2, currently
scheduled for 2016-10-16.

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


Re: Old Man Yells At Cloud

2017-09-19 Thread Pavol Lisy
On 9/19/17, Steve D'Aprano  wrote:

[...]

> The point is, we all make the occasional silly error. Doesn't mean we should
> cripple our functions and fill the language with special cases like the
> print
> statement to avoid such rare errors. If print had always been a function,
> and
> someone suggested making it a statement, who would be willing to accept all
> those disadvantages for the sake of saving one character?

I am not going to support print as a statement in this discussion!

But what you are describing is some kind of alternative history which
did not happen.

Question was not about crippling function to statement. (Which function?)

What I mean is that if we like to convince people that it was good
decision then we need to use proper arguments.

For example some others which seems like not so proper to me:

1. "learn-unlearn" argument could be viewed differently from opposite
camp (they need to unlearn statement)
2. "print foo" save more than one character ("print foo ," more than
two characters)
3. "for sake of saving one character"? Could we really simplify
motivation of opposite side to just this? (what about breaking old
code?)

BTW if python would only bring "from __cleverness__ import
print_function" how many people would accept your reasons and use it?
And how many would rewrite old code?

How many people would say something like: "Oh it is cool! Now I could
rewrite my old code and monkey patch print!" ?
-- 
https://mail.python.org/mailman/listinfo/python-list


Greater and less than operators [was Re: [Tutor] beginning to code]

2017-09-19 Thread Steven D'Aprano
On Tue, 19 Sep 2017 17:26:55 -0700, Rick Johnson wrote:

> Of course, allowing all objects to use the `==`, `!=` sugars makes
> perfect sense, but `<`, `>`, `<=`, `>=` are meaningless outside of
> numeric-ish types.


You've never wanted to sort strings? How do you sort strings unless you 
have a concept of which string comes before the other, i.e. < operator?

>>> 'xyz' < 'abc'
False


Same applies to lists of items. Provided the items are compatible with 
ordering, so are the lists. Likewise other sequences.

And for that matter, sets. Maybe we'd prefer to use the proper 
mathematical operators ⊂ and ⊃ for subset and superset, but a good ASCII 
equivalent would be < and > instead.

Likewise, any time you want to express some sort of order relationship:

pawn < rook < knight < bishop < queen < king

perhaps. (Although, in real games of chess, the value of a piece partly 
depends on what other pieces are left on the board.)

Or perhaps you have some sort of custom DSL (Domain Specific Language) 
where > and < make handy symbols for something completely unrelated to 
ordering:

cake > oven  # put cake into the oven

cake < oven  # remove cake from oven


I don't mean that as a serious example of a useful DSL. But it is the 
kind of thing we might want to do. Only hopefully less lame.



-- 
Steven D'Aprano
“You are deluded if you think software engineers who can't write 
operating systems or applications without security holes, can write 
virtualization layers without security holes.” —Theo de Raadt
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31517] MainThread association logic is fragile

2017-09-19 Thread Nick Coghlan

Nick Coghlan added the comment:

One place where this came up recently is in working out precisely how a 
Python-level subinterpreter API will interact with the threading API: 
https://mail.python.org/pipermail/python-dev/2017-September/149566.html

That said, I do agree with Tim that the status quo isn't broken per se: we 
renamed `thread` to `_thread` in Python 3 for a reason, and that reason is that 
you really need to know how Python's threading internals work to do it safely.

However, I do think we can treat this as a documentation enhancement request, 
where the `_thread` module docs could point out some of the requirements to 
ensure that low-level thread manipulation plays nice with the threading module.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
type: behavior -> enhancement

___
Python tracker 

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



[issue31525] require sqlite3_prepare_v2

2017-09-19 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
keywords: +patch
pull_requests: +3655
stage:  -> patch review

___
Python tracker 

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



[issue31525] require sqlite3_prepare_v2

2017-09-19 Thread Benjamin Peterson

Benjamin Peterson added the comment:

ermm, yes, I guess I was looking at an old version of the code.

--
title: switch to sqlite3_prepare_v2 -> require sqlite3_prepare_v2

___
Python tracker 

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



[issue31506] Improve the error message logic for object_new & object_init

2017-09-19 Thread Nick Coghlan

Nick Coghlan added the comment:

Reopening, as I was a little hasty with the merge button: the merged PR *also* 
changed the `__init__` error message to drop the method name, but I don't think 
that's what we want.

I'm also wondering if we should change the up-call case to *always* report the 
method name.

That is, we'd implement the following revised behaviour:

# Without any method overrides
class C:
pass

C(42) -> "TypeError: C() takes no arguments"
C.__new__(42) -> "TypeError: C() takes no arguments"
C().__init__(42) -> "TypeError: C.__init__() takes no arguments"
# These next two quirks are the price we pay for the nicer errors above
object.__new__(C, 42) -> "TypeError: C() takes no arguments"
object.__init__(C(), 42) -> "TypeError: C.__init__() takes no arguments"

# With method overrides
class D:
def __new__(cls, *args, **kwds):
super().__new__(cls, *args, **kwds)
def __init__(self, *args, **kwds):
super().__init__(*args, **kwds)

D(42) -> "TypeError: object.__new__() takes no arguments"
D.__new__(42) -> "TypeError: object.__new__() takes no arguments"
D().__init__(42) -> "TypeError: object.__init__() takes no arguments"
object.__new__(C, 42) -> "TypeError: object.__new__() takes no arguments"
object.__init__(C(), 42) -> "TypeError: object.__init__() takes no 
arguments"

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

___
Python tracker 

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



[issue31506] Improve the error message logic for object_new & object_init

2017-09-19 Thread Nick Coghlan

Changes by Nick Coghlan :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



Re: Old Man Yells At Cloud

2017-09-19 Thread MRAB

On 2017-09-20 01:41, Stefan Ram wrote:

Steve D'Aprano  writes:

A simple "autocorrect" in *what*? The interpreter? The editor? Both?


   I imagine something like this: When the editor gets the
   command to run the contents of the buffer as Python,
   it would then do the autocorrect in the buffer (making a
   backup first or preparing an undo feature) as a kind of
   preprocessor and then send the result to Python. But the
   user is encouraged to also continue to work with the result
   of the preprocessor.


Do you think Microsoft will consider adding it to Notepad? I seem to recall that
you use an editor which doesn't even auto-indent after a colon.


   In fact, in my courses, I often use Notepad.

   In my Python course, I will use the console that comes with
   Python and, later, I may introduce how to create source files
   with Notepad, but I will also show IDLE.

Notepad is very basic. There are many free and open-source text editors 
available. I suggest you try one!

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


[issue31506] Improve the error message logic for object_new & object_init

2017-09-19 Thread Nick Coghlan

Nick Coghlan added the comment:


New changeset a6c0c0695614177c8b6e1840465375eefcfee586 by Nick Coghlan (Serhiy 
Storchaka) in branch 'master':
bpo-31506: Improve the error message logic for object.__new__ and 
object.__init__. (GH-3650)
https://github.com/python/cpython/commit/a6c0c0695614177c8b6e1840465375eefcfee586


--

___
Python tracker 

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



[issue31525] switch to sqlite3_prepare_v2

2017-09-19 Thread Berker Peksag

Berker Peksag added the comment:

We already use sqlite3_prepare_v2 if it's available: 
https://github.com/python/cpython/blob/master/Modules/_sqlite/util.h#L43

Do you want to use sqlite3_prepare_v2() unconditionally and drop support for 
older SQLite versions?

--
nosy: +berker.peksag

___
Python tracker 

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



[issue31498] Default values for zero in time.strftime()

2017-09-19 Thread Denis Osipov

Denis Osipov added the comment:

Thank you for your answers. It's what I want to know. It looks like I shouldn't 
try to fix (to break) something that works well enough.

If nobody minds I'll close the issue with not a bug resolution.

--

___
Python tracker 

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



Re: [Tutor] beginning to code

2017-09-19 Thread INADA Naoki
>
> >>> False > 1
> False
> >>> dir > 1
> True
> >>> isinstance < 100
> False
> >>> "" >= 10
> True
> >>> (1,) <= 500
> False
>
> And down the rabbit hole we go!
>
> Now, not only do we have magic that implicitly casts all
> objects to booleans in conditional statements *AND* we have
> arbitrary Boolean values assigned to every Python object,
> but now, we discover that every Python object has been
> assigned an arbitrary rich comparison value as well! I
> assume the devs are using the boolean values 1 and 0 to make
> the comparison work??? But would someone be kind enough to
> chime in to confirm or deny my conjecture?
>

> Of course, allowing all objects to use the `==`, `!=` sugars
> makes perfect sense, but `<`, `>`, `<=`, `>=` are
> meaningless outside of numeric-ish types.
>
>
Now you know why Python 3 was born!
It's one of many pitfalls in Python 2 fixed in Python 3.
Welcome to Python 3 world.


> > I don't accept it because `if bool(x) == True` doesn't give
> > any information than `if x:`. Both mean just `if x is
> > truthy`.  No more information. Redundant code is just a
> > noise.
>
> So what about:
>
> if bool(x):
> # blah
>
>
I don't accept it too.  It only explains `if x is truthy value`, and it's
exactly same to `if x:`.
There are no additional information about what this code assumes.  bool()
is just noise.

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


[issue31517] MainThread association logic is fragile

2017-09-19 Thread Tim Peters

Tim Peters added the comment:

Is there a problem here?  I haven't heard of anyone even wondering about this 
before.  threading.py worries about Threads created _by_ threading.py, plus the 
magical (from its point of view) thread that first imports threading.py.  Users 
mix in `_thread` threads, or raw C threads from extension modules, essentially 
at their own risk.  Which risks are minimal, but can have visible consequences.

I don't view that as being a real problem.  It might help if, e.g., a Wiki 
somewhere spelled out the consequences under different Python implementations 
(while I don't know for sure, I _expect_ the current docs just say "in normal 
conditions, the main thread is the thread from which the Python interpreter was 
started" because it doesn't want to over-specify the behavior in an area nobody 
really cares about).

--

___
Python tracker 

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



Re: Old Man Yells At Cloud

2017-09-19 Thread Ethan Furman

On 09/19/2017 09:37 AM, justin walters wrote:

On Tue, Sep 19, 2017 at 9:17 AM, Grant Edwards 
wrote:


On 2017-09-19, Jan Erik =?utf-8?q?Mostr=C3=B6m?= 
wrote:


And I'm amazed how often I see people trying to calculate

  change = sum handed over - cost

and then trying to figure out what bills/coins should be returned
instead of doing the simple thing of just adding to the cost.


When I was a kid, making change like that was something we were all
taught in school.  I have a feeling that's been dropped from most
curricula.

--
Grant Edwards   grant.b.edwardsYow! MMM-MM!!  So THIS
is
   at   BIO-NEBULATION!
   gmail.com

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




Not sure about the most recent decade, but back when I was in elementary
school(1995-2001-ish),
we definitely still learned math through how to make change.


Ah, but making change and counting change are not the same thing!

Making change: $3.61 from $10 . . . $6.39

Counting change: $3.61 from $10 --

 - (give four pennies back) $3.65
 - (give a dime back) $3.75
 - (give a quarter back) $4.00
 - (give a dollar back) $5.00
 - (give a five back) and $10.00!

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


Re: Old Man Yells At Cloud

2017-09-19 Thread Rick Johnson
On Tuesday, September 19, 2017 at 1:31:52 PM UTC-5, bartc wrote:
[...]

> Can't you get around all those with things like
> sys.stdout.write?

Yes.

> If so, what was the point of having a discrete print
> statement/function at all?

I believe the original intent was to create a universal
symbol for a "shortcut to sys.stdout.write". As you can
imagine, if every programmer is required to implement their
own version of print, not only is the wheel being re-
invented, many unique symbols would be used, and Python code
would be far less intuitive between authors.

Furthermore, i don't believe print should have ever been
expanded for use _outside_ of the most simple outputs. For
instance: using print for advanced things like redirecting
output is going beyond the scope of a special purpose
shortcut.

Finally, (and this is most important) i believe that when
print() and input() are over-utilized, noobs, especially
those who do not have an understanding of IO streams, fail
to realize that print() and input() are just shortcuts to
the more feature-rich objects living in the `sys` module. In
fact, for a noob who begins programming with Python
(especially when outside of a structured academic
environment) they are likely to never make the connection,
or, at least, not make the connection for a very long time.
And being that IO streams are one of the fundamentals of
programming, such a heavy reliance on shortcuts is harmful
to the intellectual development of these students.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31524] mailbox._mboxMMDF.get_message throws away From envelope

2017-09-19 Thread R. David Murray

R. David Murray added the comment:

It just needs to call set_unixfrom as well as set_from.  I don't know why the 
MMDFMessage tracks it separately, but I'm sure the author had a reason that 
seemed good at the time :)

--

___
Python tracker 

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



[issue31525] switch to sqlite3_prepare_v2

2017-09-19 Thread Benjamin Peterson

New submission from Benjamin Peterson:

sqlite has had the sqlite3_prepare_v2 API for more than 10 years now. The 
sqlite module should switch to using it, which will let us delete some code for 
automatically recompiling statements.

--
components: Extension Modules
messages: 302581
nosy: benjamin.peterson
priority: normal
severity: normal
status: open
title: switch to sqlite3_prepare_v2
versions: Python 3.7

___
Python tracker 

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



Re: Old Man Yells At Cloud

2017-09-19 Thread Rick Johnson
On Tuesday, September 19, 2017 at 12:55:14 PM UTC-5, Chris Angelico wrote:
> On Wed, Sep 20, 2017 at 3:44 AM, Stefan Ram  wrote:
> > Steve D'Aprano  did *not* write
> > [it was edited/abbreviated by me - S. R.]:
> > |disadvantages:
> > |0 - it makes print a special thing

No more "special" than any other reserved word in Python.

> > |1 - beginners have to unlearn

Only if they decide to move to Python3 *AND* only if they
decide to use the print function at _all_. Not everyone uses
print (function or statement). Many folks prefer the power
of the logging module, or use the implicit output of a
REPL.

> > |2 - `print(x, y)` is *not* the same as `print x, y`;

Well, duh! 

> > |3 - it has bizarre syntax that nobody would find normal

Only in advanced usage, which can be better handled by using
sys.stdout.write(...)

> > |4 - you can't pass keyword arguments

Only in advanced cases do you need to. In those cases, wrap
sys.stdout.write with your own function:

# PYTHON 2.x
>>> import sys
>>> def myPrintFunc(*args, **kw):
... sys.stdout.write(' '.join(str(arg) for arg in args))
... 
>>>  myPrintFunc("Monkey", "Patching", "is easy", 2, "do!")
Monkey Patching is easy 2 do!

I'll leave the remaining feature implementations as an
exercise for the reader...

> > |5 - it can't be mocked, shadowed, monkey-patched or replaced for testing;

So wrap sys.stdout.write with your own function and then
mock it until it crys and runs home to mommy; shadow it
until it reports you as a stalker; and monkey patch it until
your sewing hand becomes racked with arthritic pain!

> > |6 - and you can't even write help(print) in the interactive interpreter

Hmm, neither can you get help for these:

# PYTHON 2.x
>>> help(del)
SyntaxError: invalid syntax
>>> help(if)
SyntaxError: invalid syntax
>>> help(else)
SyntaxError: invalid syntax
>>> help(for)
SyntaxError: invalid syntax
>>> help(class)
SyntaxError: invalid syntax
>>> help(def)
SyntaxError: invalid syntax

And this doesn't work either:

>>> help(python)
Traceback (most recent call last):
  File "", line 1, in 
help(python)
NameError: name 'python' is not defined

nor this:

>>> help(BDFL)
Traceback (most recent call last):
  File "", line 1, in 
help(BDFL)
NameError: name 'BDFL' is not defined

nor even this:

>>> help("I've fallen and i can't get up!")
no Python documentation found for "I've fallen and i can't get up!"

Why, what a surprise!!!

These so-called "disadvantages" are nothing but absurdities
masquerading as debate, and more evidence that Steven, along
with Chris, are on a Python3 religious crusade to rid the
world of perceived infidels. 
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31500] IDLE: Tiny font on HiDPI display

2017-09-19 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I mean '  if scaling >= 1.2:' in run.fix_scaling.  It would also be interesting 
to instead replace the last line,  "font['size'] = -size" with "font['size'] = 
9" (or 8 or 10) and see how close the dialog is to what is was before.

--

___
Python tracker 

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



[issue31500] IDLE: Tiny font on HiDPI display

2017-09-19 Thread Terry J. Reedy

Terry J. Reedy added the comment:

It appears that the cutoff of 1.2 in the patch is too low.  Try raising it to 
1.4 and you should see the dialog normal.

--

___
Python tracker 

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



[issue31524] mailbox._mboxMMDF.get_message throws away From envelope

2017-09-19 Thread bpoaugust

bpoaugust added the comment:

I believe that setting the file back to the start is probably the best solution.

The message as provided by e.g. postfix will include the From header and the 
parser is able to deal with that successfully, so I'm not sure why the mbox 
reader removes it before calling the parser. It only really needs to drop the 
trailing newline to ensure that the parser gets the same data.

--

___
Python tracker 

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



[issue31524] mailbox._mboxMMDF.get_message throws away From envelope

2017-09-19 Thread bpoaugust

bpoaugust added the comment:

It is not saving the unix from line.

#!/usr/bin/env python3

with open("test.mbox",'w') as f:
f.write("From sender@invalid Thu Nov 17 00:49:30 2016\n")
f.write("Subject: Test\n")
f.write("\n")
f.write("\n")

import mailbox
messages = mailbox.mbox("test.mbox")
for msg in messages:
print(msg.get('subject'))
print(msg.get_from())
print(msg.get_unixfrom())

--

___
Python tracker 

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



[issue31508] Running test_ttk_guionly logs "test_widgets.py:1562: UserWarning: Deprecated API of Treeview.selection() should be removed" warnings

2017-09-19 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Serhiy,

In tkinter __init__.py, there's messages on trace_variable and other trace 
functions about adding a deprecation warning.  I didn't know if you intended to 
make those changes as well.

--
nosy: +csabella

___
Python tracker 

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



Re: Old Man Yells At Cloud

2017-09-19 Thread Rick Johnson
On Tuesday, September 19, 2017 at 2:08:05 AM UTC-5, Steven D'Aprano wrote:
> [...]
> 5.6775 is a much more useful answer than Fraction(2271, 400). ("What's 
> that in real money?")

Steven, you're not using floats for currency are you? 

Tsk tsk!

Besides, if Python division returned a useless fraction like
Fraction(2271, 400), all you'd have to do is cast it to
something appropriate, which in the case of currency, would
be a decimal, not a float.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Tutor] beginning to code

2017-09-19 Thread Steve D'Aprano
On Wed, 20 Sep 2017 03:22 am, Chris Angelico wrote:

> On Wed, Sep 20, 2017 at 2:20 AM, Steve D'Aprano
>  wrote:
>> I can only think of four operations which are plausibly universal:
>>
>> Identity: compare two operands for identity. In this case, the type of the
>> object is irrelevant.
>>
>> Kind: interrogate an object to find out what kind of thing it is (what class
>> or type it is). In Python we have type(obj) and isinstance(x, Type), plus a
>> slightly more specialised version issubclass.
>>
>> Convert to a string or human-readable representation.
>>
>> And test whether an object is truthy or falsey.
> 
> Equality checks are also close to universal. If you ask if this list
> is equal to that timestamp, you don't get an exception, you get False.


Ah yes! Good one, and an obvious one. Asking whether two things are
equal/unequal should be universal to.



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

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


[issue31524] mailbox._mboxMMDF.get_message throws away From envelope

2017-09-19 Thread R. David Murray

R. David Murray added the comment:

It looks like it is saving it (the set_from line).  Do you have a test that 
proves otherwise?

--

___
Python tracker 

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



[issue31500] IDLE: Tiny font on HiDPI display

2017-09-19 Thread Cheryl Sabella

Cheryl Sabella added the comment:

configdialog looks better now, but the fonts are still huge.  The configdialog 
is almost bigger than the shell when it opens.

--
Added file: https://bugs.python.org/file47155/configkey_2.png

___
Python tracker 

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



Re: Old Man Yells At Cloud

2017-09-19 Thread Steve D'Aprano
On Wed, 20 Sep 2017 04:31 am, bartc wrote:

> On 19/09/2017 17:30, Steve D'Aprano wrote:

[snip list of problems with print]

> Can't you get around all those with things like sys.stdout.write?

If you had kept reading, you would have seen that I wrote:

Of course an experienced Python coder can work around all these 
problems. The main way to work around them is to *stop using print*.

Using sys.stdout.write has disadvantages:

- it only takes a single string argument;

- which makes you responsible for doing everything that print does:

  * converting arbitrary arguments to strings;
  * joining them with spaces (or some other separator);
  * appending a newline (or other delimiter) at the end;
  * flushing the buffer;

- it's about three times as long to type as "print";

- are you sure sys.stdout is pointing where you expect?

So to work around *those* problems, you end up writing your own helper function,
which invariably ends up being called something like print1.


> If so, what was the point of having a discrete print statement/function
> at all?

It is easily discoverable for beginners.

You don't have to learn the concepts of modules, importing, attribute access,
methods, files, string escapes \n etc before being able to display output to
the user.

Don't get me wrong. I love print. Even the print statement is better than
nothing. But once you get past the simple cases:

print "Hello World!"

you quickly run into its limitations.


-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

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


[issue31500] IDLE: Tiny font on HiDPI display

2017-09-19 Thread Cheryl Sabella

Cheryl Sabella added the comment:

>>> import tkinter as tk
>>> root = tk.Tk()
>>> print(float(root.tk.call('tk', 'scaling')))
1.

--

___
Python tracker 

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



[issue31500] IDLE: Tiny font on HiDPI display

2017-09-19 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 97be14996b247b853ead77fb255d7029e3cf3dc9 by Terry Jan Reedy (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-31500: Removed fixed size of IDLE config dialog. (GH-3664) (#3665)
https://github.com/python/cpython/commit/97be14996b247b853ead77fb255d7029e3cf3dc9


--

___
Python tracker 

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



[issue31522] _mboxMMDF.get_string() fails to pass param to get_bytes()

2017-09-19 Thread bpoaugust

bpoaugust added the comment:

Ignore msg302569 - that was supposed to be a new issue.

--

___
Python tracker 

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



[issue31524] mailbox._mboxMMDF.get_message throws away From envelope

2017-09-19 Thread bpoaugust

New submission from bpoaugust:

https://github.com/python/cpython/blob/master/Lib/mailbox.py#L778

The code here reads the first line, but fails to save it as the unixfrom line.

Alternatively perhaps it should reset the file back to the start so the message 
factory has sight of the envelope.

The end result is that the envelope is lost.

--
components: email
messages: 302570
nosy: barry, bpoaugust, r.david.murray
priority: normal
severity: normal
status: open
title: mailbox._mboxMMDF.get_message throws away From envelope
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue31522] _mboxMMDF.get_string() fails to pass param to get_bytes()

2017-09-19 Thread bpoaugust

Changes by bpoaugust :


--
title: mailbox._mboxMMDF.get_message throws away From envelope -> 
_mboxMMDF.get_string() fails to pass param to get_bytes()

___
Python tracker 

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



[issue31522] mailbox._mboxMMDF.get_message throws away From envelope

2017-09-19 Thread bpoaugust

bpoaugust added the comment:

https://github.com/python/cpython/blob/master/Lib/mailbox.py#L778

The code here reads the first line, but fails to save it as the unixfrom line.

Alternatively perhaps it should reset the file back to the start so the message 
factory has sight of the envelope.

The end result is that the envelope is lost.

--
title: _mboxMMDF.get_string() fails to pass param to get_bytes() -> 
mailbox._mboxMMDF.get_message throws away From envelope

___
Python tracker 

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



Re: String to Dictionary conversion in python

2017-09-19 Thread sohcahtoa82
On Thursday, September 14, 2017 at 11:01:46 PM UTC-7, santosh.y...@gmail.com 
wrote:
> Hi,
> 
> Can anyone help me in the below issue.
> 
> I need to convert string to dictionary 
> 
> string = " 'msisdn': '7382432382', 'action': 'select', 'sessionId': '123', 
> 'recipient': '7382432382', 'language': 'english'"
> 
> Can anyone help me with the code

We're not going to do your homework for you.  What have you tried?  What errors 
are you getting?  If you're replying with your code or an error, make sure to 
use Copy/Paste and DO NOT just manually re-type the code or error.  Also, make 
sure to post the entire traceback.

If literal_eval is out of the question, take a look at the str.split() 
function.  I'd split on a comma, then for each result, split on the colon, then 
strip out the single quotes.

The actual coding of that is an exercise for the reader.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31523] Windows build file fixes

2017-09-19 Thread Steve Dower

Steve Dower added the comment:

Also:

* build releases to versioned subdirectories of Py_IntDir when it is set

--

___
Python tracker 

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



[issue31523] Windows build file fixes

2017-09-19 Thread Steve Dower

New submission from Steve Dower:

This is basically a note to myself to go and fix these things when I have time 
(before 3.7a2):

* split upload steps so we can fail on real failures
* fail immediately if gpg2 step fails
* purge and retry if download fails

--
assignee: steve.dower
messages: 302567
nosy: steve.dower
priority: normal
severity: normal
stage: needs patch
status: open
title: Windows build file fixes
type: compile error
versions: Python 3.7

___
Python tracker 

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



[issue31500] IDLE: Tiny font on HiDPI display

2017-09-19 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3654

___
Python tracker 

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



[issue31500] IDLE: Tiny font on HiDPI display

2017-09-19 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset d6e2f26f3f7c62a4ddbf668027d3ba27cb0e1eca by Terry Jan Reedy in 
branch 'master':
bpo-31500: Removed fixed size of IDLE config dialog. (#3664)
https://github.com/python/cpython/commit/d6e2f26f3f7c62a4ddbf668027d3ba27cb0e1eca


--

___
Python tracker 

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



[issue31501] Operator precedence description for arithmetic operators

2017-09-19 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset e2593aa673c0347a74c4896a519e3b8cb7b55eb4 by Mariatta (Miss 
Islington (bot)) in branch '3.6':
bpo-31501: Operator precedence description for arithmetic operators (GH-3633) 
(GH-3638)
https://github.com/python/cpython/commit/e2593aa673c0347a74c4896a519e3b8cb7b55eb4


--

___
Python tracker 

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



[issue31522] _mboxMMDF.get_string() fails to pass param to get_bytes()

2017-09-19 Thread bpoaugust

New submission from bpoaugust:

See:
https://github.com/python/cpython/blob/master/Lib/mailbox.py#L787

The code should be

self.get_bytes(key, from_)).as_string(unixfrom=from_)

--
components: email
messages: 302564
nosy: barry, bpoaugust, r.david.murray
priority: normal
severity: normal
status: open
title: _mboxMMDF.get_string() fails to pass param to get_bytes()
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue31500] IDLE: Tiny font on HiDPI display

2017-09-19 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +3653

___
Python tracker 

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



[issue31500] IDLE: Tiny font on HiDPI display

2017-09-19 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Cheryl, what do you get with

import tkinter as tk
root = tk.Tk()
print(float(root.tk.call('tk', 'scaling')))

If it is less than 1.2, then Serhiy's revised patch should leave config dialog 
as it should be.

--

___
Python tracker 

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



[issue26673] Tkinter error when opening IDLE configuration menu (Tcl/Tk 8.6)

2017-09-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +3652

___
Python tracker 

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



Re: Even Older Man Yells at Whippersnappers

2017-09-19 Thread Gene Heskett
On Tuesday 19 September 2017 13:38:42 ROGER GRAYDON CHRISTMAN wrote:

>  I recall giving a quiz to my college students sometime back around
> the late nineties which had a little bit of arithmetic involved in the
> answer. It's been too long ago to still have the exact details, but I
> remember a couple solutions that would be of the form:
>
> 5 + 10 + 1*2
>
> And then the student would write he was unable to actually
> compute that without a calculator.   And yes, I deliberately
> designed the questions to have such easy numbers to work with.
>
> Roger Christman
> Pennsylvania State University

Why do we buy them books and send them to school?

Yes, that is a real question. We ought to be suing the schools for 
malpractice.  And the parents for child abuse because they didn't see to 
it the child was being properly taught. I know from raising some of 
those questions at a school board meeting, occasioned by my trying to 
act like a parent when I took on a woman with 3 children fathered by a 
myotonic muscular dystrophy victim. Those offspring typically have a 30 
year lifespan so they are long passed now.

And being told they have to follow the federal recipes.  So who the hell 
do we sue to put some "education" back into the classroom?  The only way 
we'll fix it is to cost the decision makers their salaries.  And we 
start that by talking to the candidates, and voting them in or out 
accordingly in those regions where they are elected.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31516] current_thread() becomes "dummy" thread during shutdown

2017-09-19 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



Re: Issues with pip installation on windows

2017-09-19 Thread MRAB

On 2017-09-19 20:19, Bill Deegan wrote:

try using: python -m pip 
Does that work?


If you want to be more specific, you can use the Python launcher:

py -3.6 -m pip 


On Tue, Sep 19, 2017 at 12:47 PM, Joey Steward 
wrote:


-- Forwarded message --
From: Joey Steward 
Date: Mon, Sep 18, 2017 at 3:26 PM
Subject: Issues with pip installation on windows
To: python-list@python.org


Hello,

I'm a new programmer who initially began learning python for bioinformatics
and data analysis applications, but have recently become interested by web
development so I've set out to learn django.

 I used to use an ubuntu operating system when I was previously learning
some aspects of bioinformatics but recently switched to a new computer with
windows 10. I've been trying to use pip but continue getting an error
message on the command line when I try to use pip (basically saying pip
isn't a recognized command).

I have been checking that pip installed though and up to date with the
version of the python download I'm using ( was trying 3.6 and then switched
to 2.7) so I feel it has something to do with how I have the setup that pip
isn't being recognized, but I haven't been able to find any solutions with
google searches.

Is there any info out there that'd be good for a novice to check out to
solve this?

If so would greatly appreciate it!

All the best,

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





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


Re: Even Older Man Yells At Whippersnappers

2017-09-19 Thread MRAB

On 2017-09-19 17:46, Larry Martell wrote:

On Tue, Sep 19, 2017 at 12:12 PM, Rhodri James  wrote:


Eh, my school never 'ad an electronics class, nor a computer neither. Made
programming a bit tricky; we 'ad to write programs on a form and send 'em
off to next county.  None of this new-fangled VHDL neither, we 'ad to do our
simulations with paper and pencil.



We dreamed of writing programs on a form. We had to make Hollerith
punch cards by hand using a dull knife. You tell that to the kids of
today and they won't believe you.


You had a _knife_?
--
https://mail.python.org/mailman/listinfo/python-list


Re: Even Older Man Yells At Whippersnappers

2017-09-19 Thread MRAB

On 2017-09-19 19:15, Christopher Reimer wrote:

On Sep 19, 2017, at 9:09 AM, justin walters  wrote:

On Tue, Sep 19, 2017 at 8:59 AM, Grant Edwards 
wrote:


On 2017-09-19, Rhodri James  wrote:

On 19/09/17 16:00, Stefan Ram wrote:
D'Arcy Cain  writes:

of course, I use calculators and computers but I still understand the
theory behind what I am doing.


  I started out programming in BASIC. Today, I use Python,
  the BASIC of the 21st century. Python has no GOTO, but when
  it is executed, its for loop eventually is implemented using
  a GOTO-like jump instruction. Thanks to my learning of BASIC,
  /I/ can have this insight. Younger people, who never learned
  GOTO, may still be able to use Python, but they will not
  understand what is going on behind the curtains. Therefore, for
  a profound understanding of Python, everyone should learn BASIC
  first, just like I did!


Tsk.  You should have learned (a fake simplified) assembler first, then
you'd have an appreciation of what your processor actually did.

:-)


Tsk, Tsk.  Before learning assembly, you should design an instruction
set and implement it in hardare.  Or at least run in in a VHDL
simulator.  [Actually, back in my undergrad days we used AHPL and
implemented something like a simplified PDP-11 ISA.]

Alternatively, you should design an instruction set and implement it
using microcode and AM2900 bit-slice processors.

--
Grant Edwards   grant.b.edwardsYow! Could I have a drug
 at   overdose?
 gmail.com

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



Even Assembly is easy nowadays:
https://fresh.flatassembler.net/index.cgi?page=content/1_screenshots.txt
--
https://mail.python.org/mailman/listinfo/python-list


Is assembly still a thing today?

I wanted to take assembly in college but I was the only student who showed up 
and the class got cancelled. I dabbled with 8-but assembly as a kid. I can't 
imagine what assembly is on a 64-bit processor.

Assembler? I started out on a hex keypad. I still remember that hex C4 
was LDI.


Assembler on, say, a 6502 or ARM is pretty nice! :-)
--
https://mail.python.org/mailman/listinfo/python-list


Re: Old Man Yells At Cloud

2017-09-19 Thread Chris Angelico
On Wed, Sep 20, 2017 at 4:59 AM, Stefan Ram  wrote:
> "Jan Erik =?utf-8?q?Mostr=C3=B6m?="  writes:
>>And I'm amazed how often I see people trying to calculate
>>change = sum handed over - cost
>>and then trying to figure out what bills/coins should be returned
>>instead of doing the simple thing of just adding to the cost.
>
>   I don't get this. For example, the contractual payment (cost) is
>
> 47.21
>
>   , the other party hands over
>
> 50.25
>
>   . Now I am supposed to add /what/ to the cost?

Start at the smallest end. You need to make 21 cents up to 25. So hand
back four pennies. Then make 47 dollars up to 50. Here in Australia,
that would mean a $1 coin and a $2 coin; in the US, probably three $1
notes. You count 'em off: starting at 47, hand a dollar, 48, another
dollar, 49, a third dollar, 50. Now you've added the change onto the
cost, reaching the amount paid.

It's more useful when the customer *hasn't* tried to be helpful; what
you're doing is rounding everything up to the next unit. I'm going to
assume pre-1992 Australian currency (when we still had 1c and 2c
coins) - feel free to adjust to your own. The cost is $47.21; the
customer handed over a $50 note. You say the parts in quotes.

* Quote the value of the bill. "Forty-seven dollars twenty-one."
* Build 21 cents up to 25. Two 2c coins: "23, 25"
* Build 25 cents up to 30. One 5c coin: "30"
* Build 30 up to 50. One 20c coin: "50"
* Build 50 up to the next dollar. One 50c coin: "48 dollars."
* Build that up to the amount paid. One $2 coin: "50."

Or of course you could use other denominations (maybe a pair of $1
coins if you're out of twos), in which case you'd say that
appropriately ("49, 50").

Does that make sense?

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


[issue31518] ftplib, urllib2, poplib, httplib, urllib2_localnet use ssl.PROTOCOL_TLSv1 unconditionally

2017-09-19 Thread Christian Heimes

Christian Heimes added the comment:

PR 3660 and PR 3661 address most of the failing tests. The two failures in 
msg302531 are discussed in issue #31453.

--

___
Python tracker 

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



Re: Issues with pip installation on windows

2017-09-19 Thread Bill Deegan
try using: python -m pip 
Does that work?

On Tue, Sep 19, 2017 at 12:47 PM, Joey Steward 
wrote:

> -- Forwarded message --
> From: Joey Steward 
> Date: Mon, Sep 18, 2017 at 3:26 PM
> Subject: Issues with pip installation on windows
> To: python-list@python.org
>
>
> Hello,
>
> I'm a new programmer who initially began learning python for bioinformatics
> and data analysis applications, but have recently become interested by web
> development so I've set out to learn django.
>
>  I used to use an ubuntu operating system when I was previously learning
> some aspects of bioinformatics but recently switched to a new computer with
> windows 10. I've been trying to use pip but continue getting an error
> message on the command line when I try to use pip (basically saying pip
> isn't a recognized command).
>
> I have been checking that pip installed though and up to date with the
> version of the python download I'm using ( was trying 3.6 and then switched
> to 2.7) so I feel it has something to do with how I have the setup that pip
> isn't being recognized, but I haven't been able to find any solutions with
> google searches.
>
> Is there any info out there that'd be good for a novice to check out to
> solve this?
>
> If so would greatly appreciate it!
>
> All the best,
>
> Joey Steward
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31453] Debian Sid/Buster: Cannot enable TLS 1.0/1.1 with PROTOCOL_TLS

2017-09-19 Thread Christian Heimes

Christian Heimes added the comment:

PR 3662 undos Debian's patching of OpenSSL. I'm not keen to undo a security 
improvement. However Debian is breaking backwards compatibility. For Python 3.7 
we could consider to disable TLS 1.0 and TLS 1.1 for PROTOCOL_TLS_SERVER and 
PROTOCOL_TLS_CLIENT.

--

___
Python tracker 

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



Re: Even Older Man Yells At Whippersnappers

2017-09-19 Thread Christopher Reimer
> On Sep 19, 2017, at 9:09 AM, justin walters  
> wrote:
> 
> On Tue, Sep 19, 2017 at 8:59 AM, Grant Edwards 
> wrote:
> 
>>> On 2017-09-19, Rhodri James  wrote:
 On 19/09/17 16:00, Stefan Ram wrote:
 D'Arcy Cain  writes:
> of course, I use calculators and computers but I still understand the
> theory behind what I am doing.
 
   I started out programming in BASIC. Today, I use Python,
   the BASIC of the 21st century. Python has no GOTO, but when
   it is executed, its for loop eventually is implemented using
   a GOTO-like jump instruction. Thanks to my learning of BASIC,
   /I/ can have this insight. Younger people, who never learned
   GOTO, may still be able to use Python, but they will not
   understand what is going on behind the curtains. Therefore, for
   a profound understanding of Python, everyone should learn BASIC
   first, just like I did!
>>> 
>>> Tsk.  You should have learned (a fake simplified) assembler first, then
>>> you'd have an appreciation of what your processor actually did.
>>> 
>>> :-)
>> 
>> Tsk, Tsk.  Before learning assembly, you should design an instruction
>> set and implement it in hardare.  Or at least run in in a VHDL
>> simulator.  [Actually, back in my undergrad days we used AHPL and
>> implemented something like a simplified PDP-11 ISA.]
>> 
>> Alternatively, you should design an instruction set and implement it
>> using microcode and AM2900 bit-slice processors.
>> 
>> --
>> Grant Edwards   grant.b.edwardsYow! Could I have a drug
>>  at   overdose?
>>  gmail.com
>> 
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>> 
> 
> Even Assembly is easy nowadays:
> https://fresh.flatassembler.net/index.cgi?page=content/1_screenshots.txt
> -- 
> https://mail.python.org/mailman/listinfo/python-list

Is assembly still a thing today? 

I wanted to take assembly in college but I was the only student who showed up 
and the class got cancelled. I dabbled with 8-but assembly as a kid. I can't 
imagine what assembly is on a 64-bit processor.

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


[issue31507] email.utils.parseaddr has no docstring

2017-09-19 Thread R. David Murray

R. David Murray added the comment:


New changeset 9e7b9b21fe45f7d93eaf9382fedfa18247d0d2b2 by R. David Murray 
(Rohit Balasubramanian) in branch 'master':
bpo-31507 Add docstring to parseaddr function in email.utils.parseaddr (gh-3647)
https://github.com/python/cpython/commit/9e7b9b21fe45f7d93eaf9382fedfa18247d0d2b2


--

___
Python tracker 

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



[issue31415] Add -X option to show import time

2017-09-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If this proposition be accepted I would want to see not only cumulated times, 
but also pure times, without time of nested imports.

I guess this feature doesn't work correctly with threading.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31453] Debian Sid/Buster: Cannot enable TLS 1.0/1.1 with PROTOCOL_TLS

2017-09-19 Thread Christian Heimes

Changes by Christian Heimes :


--
keywords: +patch
pull_requests: +3651
stage:  -> patch review

___
Python tracker 

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



[issue31518] ftplib, urllib2, poplib, httplib, urllib2_localnet use ssl.PROTOCOL_TLSv1 unconditionally

2017-09-19 Thread Matthias Klose

Matthias Klose added the comment:

Christian, I assume you'd like to see a test which can be done at *runtime*, 
not *buildtime*.  Assuming you have that openssl upstream patch available in 
your build dependency, would that help with the detection?  If yes, I'll talk 
to Debian's and Ubuntu's openssl maintainers to backport it, so the _ssl module 
could use it depending on a configure check.

--

___
Python tracker 

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



Re: Old Man Yells At Cloud

2017-09-19 Thread bartc

On 19/09/2017 17:26, Larry Martell wrote:

On Tue, Sep 19, 2017 at 10:30 AM, D'Arcy Cain  wrote:

On 09/19/2017 06:46 AM, Larry Martell wrote:


True story - the other day I was in a store and my total was $10.12. I



One time I was at a cash with three or four items which were taxable. The
cashier rung each one up and hit the total button.  She turned to me and
said something like "$23.42 please."  She was surprised to see that I was
already standing there with $23.42 in my hand.  "How did you do that" she
asked.  She must have thought it was a magic trick.


I was just in a clothing store this weekend and there was a rack of
clothes that was 50%. The sales clerk said everything on that rack was
an additional 25% off, so it's 75% off the original price. I asked is
it 75% off the original price or 25% off the 50% of the price. Said
it's the same thing. I said no it's not. She insisted it was. I said
no, let's take a simple example. If it was $100 and it was 75% off it
would be $25. But if it's 50% off and then 25% off that it will be
$37.50. She looked totally dumbfounded.



Most people (in the general population, doubtless not in this group) 
seem to be confused about things like that.


Your house has gone down in value by 30% this year; it will need to 
increase by 43% to be back where it was last year, not 30%.


Value-Added-Tax in the UK increased from 17.5% to 20%, everyone was 
talking about a 2.5% increase in prices. The increase would actually be 
just over 2.1% (a £100 ex-VAT price increases from £117.50 to £120.00).


Etc.


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


[issue31518] ftplib, urllib2, poplib, httplib, urllib2_localnet use ssl.PROTOCOL_TLSv1 unconditionally

2017-09-19 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3650

___
Python tracker 

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



[issue31518] ftplib, urllib2, poplib, httplib, urllib2_localnet use ssl.PROTOCOL_TLSv1 unconditionally

2017-09-19 Thread Christian Heimes

Changes by Christian Heimes :


--
keywords: +patch
pull_requests: +3649
stage:  -> patch review

___
Python tracker 

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



Re: Even Older Man Yells at Whippersnappers

2017-09-19 Thread Rhodri James

On 19/09/17 19:33, Larry Martell wrote:

On Tue, Sep 19, 2017 at 1:38 PM, ROGER GRAYDON CHRISTMAN  wrote:

  I recall giving a quiz to my college students sometime back around
the late nineties which had a little bit of arithmetic involved in the answer.
It's been too long ago to still have the exact details, but I remember
a couple solutions that would be of the form:

5 + 10 + 1*2

And then the student would write he was unable to actually
compute that without a calculator.   And yes, I deliberately
designed the questions to have such easy numbers to work with.


It was my birthday the other day. People at worked asked how old I
was. I replied:

((3**2)+math.sqrt(400))*2

Quite a few people somehow came up with 47. And these are technical people.


You obviously look very spry for your age.

--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


Re: Even Older Man Yells at Whippersnappers

2017-09-19 Thread Chris Angelico
On Wed, Sep 20, 2017 at 4:33 AM, Larry Martell  wrote:
> On Tue, Sep 19, 2017 at 1:38 PM, ROGER GRAYDON CHRISTMAN  wrote:
>>  I recall giving a quiz to my college students sometime back around
>> the late nineties which had a little bit of arithmetic involved in the 
>> answer.
>> It's been too long ago to still have the exact details, but I remember
>> a couple solutions that would be of the form:
>>
>> 5 + 10 + 1*2
>>
>> And then the student would write he was unable to actually
>> compute that without a calculator.   And yes, I deliberately
>> designed the questions to have such easy numbers to work with.
>
> It was my birthday the other day. People at worked asked how old I
> was. I replied:
>
> ((3**2)+math.sqrt(400))*2
>
> Quite a few people somehow came up with 47. And these are technical people.

*headscratch* Multiple people got 47? I'm struggling to figure that
out. If they interpret the first part as multiplication (3*2 => 6),
that would get 26*2 => 52; if they don't understand the square
rooting, they'd probably just give up; if they ignore the parentheses,
that could give 9 + 20*2 => 49; but I can't come up with 47.

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


Re: Research paper "Energy Efficiency across Programming Languages: How does energy, time, and memory relate?"

2017-09-19 Thread leam hall
On Tue, Sep 19, 2017 at 2:37 PM, Stephan Houben <
stephan...@gmail.com.invalid> wrote:

> Op 2017-09-19, Steven D'Aprano schreef  pearwood.info>:
>
> > There is a significant chunk of the Python community for whom "just pip
> > install it" is not easy, legal or even possible. For them, if its not in
> > the standard library, it might as well not even exist.
>
> But numpy *is* in the standard library, provided you download the
> correct version of Python, namely the one from:
>
> https://python-xy.github.io/
>
> Stephan
>
>
Many of us can't pip install; it's in the OS supplied vendor repo or it
doesn't go on the machines.

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


Re: Research paper "Energy Efficiency across Programming Languages: How does energy, time, and memory relate?"

2017-09-19 Thread Stephan Houben
Op 2017-09-19, Steven D'Aprano schreef :

> There is a significant chunk of the Python community for whom "just pip 
> install it" is not easy, legal or even possible. For them, if its not in 
> the standard library, it might as well not even exist.

But numpy *is* in the standard library, provided you download the
correct version of Python, namely the one from:

https://python-xy.github.io/

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


[issue31415] Add -X option to show import time

2017-09-19 Thread INADA Naoki

INADA Naoki added the comment:

It means μs (micro seconds), in ASCII.

On 2017年9月20日(水) 3:35 Brett Cannon  wrote:

>
> Brett Cannon added the comment:
>
> What does the "[us]" mean?
>
> --
> nosy: +brett.cannon
>
> ___
> Python tracker 
> 
> ___
>
-- 
Inada Naoki 

--

___
Python tracker 

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



[issue31415] Add -X option to show import time

2017-09-19 Thread Brett Cannon

Brett Cannon added the comment:

What does the "[us]" mean?

--
nosy: +brett.cannon

___
Python tracker 

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



Re: Even Older Man Yells at Whippersnappers

2017-09-19 Thread Larry Martell
On Tue, Sep 19, 2017 at 1:38 PM, ROGER GRAYDON CHRISTMAN  wrote:
>  I recall giving a quiz to my college students sometime back around
> the late nineties which had a little bit of arithmetic involved in the answer.
> It's been too long ago to still have the exact details, but I remember
> a couple solutions that would be of the form:
>
> 5 + 10 + 1*2
>
> And then the student would write he was unable to actually
> compute that without a calculator.   And yes, I deliberately
> designed the questions to have such easy numbers to work with.

It was my birthday the other day. People at worked asked how old I
was. I replied:

((3**2)+math.sqrt(400))*2

Quite a few people somehow came up with 47. And these are technical people.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Even Older Man Yells At Whippersnappers

2017-09-19 Thread Rhodri James

On 19/09/17 17:52, justin walters wrote:

On Tue, Sep 19, 2017 at 9:12 AM, Rhodri James  wrote:



Eh, my school never 'ad an electronics class, nor a computer neither. Made
programming a bit tricky; we 'ad to write programs on a form and send 'em
off to next county.  None of this new-fangled VHDL neither, we 'ad to do
our simulations with paper and pencil.


(All true, as it happens.  My school acquired a computer (just the one: a
NorthStar Horizon) in my O-Level year, but before that we really did have
to send programs off to Worcester where someone would laboriously type them
in for you.  A week later you got a print out of the results and a roll of
paper tape with your program on it.)


What happened if there was a bug? Did you have to re-send it?



Yes.  We proofread our little programs very carefully after the first 
bug :-)


--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


[issue31521] segfault in PyBytes_AsString

2017-09-19 Thread Tim Smith

Tim Smith added the comment:

I forgot to mention, this is Arch Linux python package:

Version : 3.6.2-1
Packager: Felix Yan 
Build Date  : Wed 19 Jul 2017 01:54:34 PM MDT

I had the files on a vfat filesystem, but copied them to ext4 with the exact 
same results.

--

___
Python tracker 

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



[issue31498] Default values for zero in time.strftime()

2017-09-19 Thread R. David Murray

R. David Murray added the comment:

Yes, I think we can "fix" some things.  I don't know if this falls into the 
class of things we should fix.  I'll leave that decision to people with more 
experience with time stuff.

--

___
Python tracker 

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



[issue31521] segfault in PyBytes_AsString

2017-09-19 Thread Tim Smith

New submission from Tim Smith:

$ python -V
Python 3.6.2

This crash appears to be specific to having files with some ill-encoded 
filenames. After renaming the offending files to remove the non-ASCII 
characters, the process could complete without crashing.

$ beet import /share/Music/Berliner\ Philharmoniker\;\ Herbert\ von\ Karajan
/share/Music/Berliner Philharmoniker; Herbert von Karajan/Tristan und Isolde; 
Tannhuser; Die Meistersinger von Nrnberg (5 items)
Correcting tags from:   
   
Berliner Philharmoniker; Herbert von Karajan - Tristan und Isolde; 
Tannhäuser; Die Meistersinger von Nürnberg
  
To: 
   
Richard Wagner; Berliner Philharmoniker; Herbert von Karajan - Tristan und 
Isolde / Tannhäuser / Die Meistersinger von Nürnberg
URL:
   
https://musicbrainz.org/release/7d2cbceb-7981-4eb4-a264-0dae5b6cba55
 
(Similarity: 92.9%) (artist, year, tracks) (CD, 1994, DE, Deutsche Grammophon)  
   
 * Tannhäuser und der Sängerkrieg auf Wartburg - Ouvertüre  -> 
Tannhäuser und der Sängerkrieg auf Wartburg: Overtüre (title)
 * Tannhäuser und der Sängerkrieg auf Wartburg - Bacchanale (Venusberg) -> 
Tannhäuser und der Sängerkrieg auf Wartburg: Bacchanale (Venusberg)
 * Die Meistersinger von Nürnberg - Vorspiel zum 3. Aufzug  -> Die 
Meistersinger von Nürnberg: Vorspiel zum 3. Aufzug
 * Tristan und Isolde - Vorspiel-> 
Tristan und Isolde: Vorspiel

 * Tristan und Isolde - Isoldes Liebestod   -> 
Tristan und Isolde: Isoldes Liebstod (title)

[A]pply, More candidates, Skip, Use as-is, as Tracks, Group albums, 
   
Enter search, enter Id, aBort, Print tracks, eDit, edit Candidates? 
   
[1]22921 segmentation fault (core dumped)  beet import 
/share/Music/Berliner\ Philharmoniker\;\ Herbert\ von\ Karajan


Please find full output of `coredumpctl info` in the attached file.

Stack trace of thread 22932:
#0  0x7fd216e23514 PyBytes_AsString (libpython3.6m.so.1.0)
#1  0x7fd206dfc904 n/a (_gi.cpython-36m-x86_64-linux-gnu.so)
#2  0x7fd206dfd196 n/a (_gi.cpython-36m-x86_64-linux-gnu.so)
#3  0x7fd206dfc25f n/a (_gi.cpython-36m-x86_64-linux-gnu.so)
#4  0x7fd206ddfddf n/a (_gi.cpython-36m-x86_64-linux-gnu.so)
#5  0x7fd206de01fb n/a (_gi.cpython-36m-x86_64-linux-gnu.so)
#6  0x7fd216e4d974 _PyCFunction_FastCallDict 
(libpython3.6m.so.1.0)
#7  0x7fd216e4b82a n/a (libpython3.6m.so.1.0)
#8  0x7fd216de92ea _PyEval_EvalFrameDefault 
(libpython3.6m.so.1.0)
#9  0x7fd216e4b34a n/a (libpython3.6m.so.1.0)
#10 0x7fd216e4b8ee n/a (libpython3.6m.so.1.0)
#11 0x7fd216de92ea _PyEval_EvalFrameDefault 
(libpython3.6m.so.1.0)
#12 0x7fd216e4b34a n/a (libpython3.6m.so.1.0)
#13 0x7fd216e4b8ee n/a (libpython3.6m.so.1.0)
#14 0x7fd216de92ea _PyEval_EvalFrameDefault 
(libpython3.6m.so.1.0)
#15 0x7fd216e4b34a n/a (libpython3.6m.so.1.0)
#16 0x7fd216e4b8ee n/a (libpython3.6m.so.1.0)
#17 0x7fd216de92ea _PyEval_EvalFrameDefault 
(libpython3.6m.so.1.0)
#18 0x7fd216e4a48d n/a (libpython3.6m.so.1.0)
#19 0x7fd216e4b571 n/a (libpython3.6m.so.1.0)
#20 0x7fd216e4b8ee n/a (libpython3.6m.so.1.0)
#21 0x7fd216de92ea _PyEval_EvalFrameDefault 
(libpython3.6m.so.1.0)
#22 0x7fd216e4adba _PyFunction_FastCallDict 
(libpython3.6m.so.1.0)
#23 0x7fd216e0edce _PyObject_FastCallDict 
(libpython3.6m.so.1.0)
#24 0x7fd216e0f9d1 _PyObject_Call_Prepend 
(libpython3.6m.so.1.0)
#25 0x7fd216e0fabb PyObject_Call (libpython3.6m.so.1.0)
#26 0x7fd216dea891 _PyEval_EvalFrameDefault 
(libpython3.6m.so.1.0)
#27 0x7fd216e4a48d n/a (libpython3.6m.so.1.0)
#28 

[issue31482] random.seed() doesn't work with bytes and version=1

2017-09-19 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset c6ce8fba07ea6798eac46ab2808167afecd4d90b by Mariatta (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-31482:  Missing bytes support for random.seed() version 1 (GH-3614) 
(GH-3659)
https://github.com/python/cpython/commit/c6ce8fba07ea6798eac46ab2808167afecd4d90b


--

___
Python tracker 

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



[issue31498] Default values for zero in time.strftime()

2017-09-19 Thread Denis Osipov

Denis Osipov added the comment:

Actually now Python time.strftime not always returns the same value as C 
strftime with the same arguments, because timemodule make some refining of raw 
argument values to avoid errors.

--

___
Python tracker 

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



[issue31355] Remove Travis CI macOS job: rely on buildbots

2017-09-19 Thread Brett Cannon

Brett Cannon added the comment:

Should this be closed?

--
nosy: +brett.cannon

___
Python tracker 

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



[issue31482] random.seed() doesn't work with bytes and version=1

2017-09-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ah, now I understand what happened. Thanks Mariatta.

--

___
Python tracker 

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



Re: [Tutor] beginning to code

2017-09-19 Thread Chris Angelico
On Wed, Sep 20, 2017 at 2:20 AM, Steve D'Aprano
 wrote:
> I can only think of four operations which are plausibly universal:
>
> Identity: compare two operands for identity. In this case, the type of the
> object is irrelevant.
>
> Kind: interrogate an object to find out what kind of thing it is (what class 
> or
> type it is). In Python we have type(obj) and isinstance(x, Type), plus a
> slightly more specialised version issubclass.
>
> Convert to a string or human-readable representation.
>
> And test whether an object is truthy or falsey.

Equality checks are also close to universal. If you ask if this list
is equal to that timestamp, you don't get an exception, you get False.

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


[issue31498] Default values for zero in time.strftime()

2017-09-19 Thread Denis Osipov

Denis Osipov added the comment:

Yes, C strftime returns the same. Inside of Python time.strftime() in Windows 
we give struct tm with inconsistent attributes (year, mon, mday and wday,yday) 
as argument for C strftime().

Before it timemodule does a lot of work to parse arguments of time.strftime() 
and check if all values in obtained struct tm are correct. Also it force values 
of some attributes to correct ones. Why don't make one more step (e.g. call C 
mktime before C strftime) to give C function a struct time argument with all 
consistent attributes?

Or Python time.strftime() should return exactly the same as C strftime?

--

___
Python tracker 

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



[issue31482] random.seed() doesn't work with bytes and version=1

2017-09-19 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Serhiy, it can't be re-opened since miss-islington deleted the branch already.

--

___
Python tracker 

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



Re: Even Older Man Yells At Whippersnappers

2017-09-19 Thread justin walters
On Tue, Sep 19, 2017 at 9:12 AM, Rhodri James  wrote:

> On 19/09/17 16:59, Grant Edwards wrote:
>
>> On 2017-09-19, Rhodri James  wrote:
>>
>>> On 19/09/17 16:00, Stefan Ram wrote:
>>>
 D'Arcy Cain  writes:

> of course, I use calculators and computers but I still understand the
> theory behind what I am doing.
>

 I started out programming in BASIC. Today, I use Python,
 the BASIC of the 21st century. Python has no GOTO, but when
 it is executed, its for loop eventually is implemented using
 a GOTO-like jump instruction. Thanks to my learning of BASIC,
 /I/ can have this insight. Younger people, who never learned
 GOTO, may still be able to use Python, but they will not
 understand what is going on behind the curtains. Therefore, for
 a profound understanding of Python, everyone should learn BASIC
 first, just like I did!

>>>
>>> Tsk.  You should have learned (a fake simplified) assembler first, then
>>> you'd have an appreciation of what your processor actually did.
>>>
>>> :-)
>>>
>>
>> Tsk, Tsk.  Before learning assembly, you should design an instruction
>> set and implement it in hardare.  Or at least run in in a VHDL
>> simulator.  [Actually, back in my undergrad days we used AHPL and
>> implemented something like a simplified PDP-11 ISA.]
>>
>
> 
> Eh, my school never 'ad an electronics class, nor a computer neither. Made
> programming a bit tricky; we 'ad to write programs on a form and send 'em
> off to next county.  None of this new-fangled VHDL neither, we 'ad to do
> our simulations with paper and pencil.
> 
>
> (All true, as it happens.  My school acquired a computer (just the one: a
> NorthStar Horizon) in my O-Level year, but before that we really did have
> to send programs off to Worcester where someone would laboriously type them
> in for you.  A week later you got a print out of the results and a roll of
> paper tape with your program on it.)
>
>
> --
> Rhodri James *-* Kynesim Ltd
> --
> https://mail.python.org/mailman/listinfo/python-list
>

What happened if there was a bug? Did you have to re-send it?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Even Older Man Yells At Whippersnappers

2017-09-19 Thread Stefan Behnel
Stefan Ram schrieb am 19.09.2017 um 17:00:
> D'Arcy Cain  writes:
>> of course, I use calculators and computers but I still understand the 
>> theory behind what I am doing.
> 
>   I started out programming in BASIC. Today, I use Python,
>   the BASIC of the 21st century. Python has no GOTO, but when
>   it is executed, its for loop eventually is implemented using
>   a GOTO-like jump instruction. Thanks to my learning of BASIC,
>   /I/ can have this insight. Younger people, who never learned
>   GOTO, may still be able to use Python, but they will not 
>   understand what is going on behind the curtains. Therefore, for
>   a profound understanding of Python, everyone should learn BASIC
>   first, just like I did!

http://entrian.com/goto/

Stefan

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


[issue31479] Always reset the signal alarm in tests

2017-09-19 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy: "Maybe add a context manager? Some pattern is repeated multiple times."

As I wrote on the PR, I'm not sure because not all the code look the same. 
Please propose a PR if you want, I can review it!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue31479] Always reset the signal alarm in tests

2017-09-19 Thread STINNER Victor

STINNER Victor added the comment:

While the fix is nice to have to handle corner cases, I'm not sure that it's 
really useful to backport the change to Python 2.7 and 3.6. So I close the 
issue.

--

___
Python tracker 

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



[issue31482] random.seed() doesn't work with bytes and version=1

2017-09-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If PR 3629 was closed by mistake it could be just reopened, isn't?

--

___
Python tracker 

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



[issue31479] Always reset the signal alarm in tests

2017-09-19 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 9abee722d448c1c00c7d4e11ce242ec7b13e5c49 by Victor Stinner in 
branch 'master':
bpo-31479: Always reset the signal alarm in tests (#3588)
https://github.com/python/cpython/commit/9abee722d448c1c00c7d4e11ce242ec7b13e5c49


--

___
Python tracker 

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



Re: Old Man Yells At Cloud

2017-09-19 Thread justin walters
On Tue, Sep 19, 2017 at 9:17 AM, Grant Edwards 
wrote:

> On 2017-09-19, Jan Erik =?utf-8?q?Mostr=C3=B6m?= 
> wrote:
>
> > And I'm amazed how often I see people trying to calculate
> >
> >  change = sum handed over - cost
> >
> > and then trying to figure out what bills/coins should be returned
> > instead of doing the simple thing of just adding to the cost.
>
> When I was a kid, making change like that was something we were all
> taught in school.  I have a feeling that's been dropped from most
> curricula.
>
> --
> Grant Edwards   grant.b.edwardsYow! MMM-MM!!  So THIS
> is
>   at   BIO-NEBULATION!
>   gmail.com
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>


Not sure about the most recent decade, but back when I was in elementary
school(1995-2001-ish),
we definitely still learned math through how to make change.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue13224] Change str(x) to return only the qualname for some types

2017-09-19 Thread Guido van Rossum

Guido van Rossum added the comment:

And thanks for working it through! It was a valuable exercise.

--

___
Python tracker 

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



[issue31482] random.seed() doesn't work with bytes and version=1

2017-09-19 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Hi Raymond, 

Somehow the backport PR https://github.com/python/cpython/pull/3629 was closed 
before instead of merged.

To retrigger the backport, we can re-apply the "needs backport to 3.6" label on 
the original PR (3614). I will do this now :)

--

___
Python tracker 

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



[issue31520] ResourceWarning: unclosed warning

2017-09-19 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +martin.panter

___
Python tracker 

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



[issue31482] random.seed() doesn't work with bytes and version=1

2017-09-19 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Backport PR has been created. Once the CI checks are done, we can squash and 
merge it.

--

___
Python tracker 

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



Re: Old Man Yells At Cloud

2017-09-19 Thread Larry Martell
On Tue, Sep 19, 2017 at 10:30 AM, D'Arcy Cain  wrote:
> On 09/19/2017 06:46 AM, Larry Martell wrote:
>>
>> True story - the other day I was in a store and my total was $10.12. I
>
>
> One time I was at a cash with three or four items which were taxable. The
> cashier rung each one up and hit the total button.  She turned to me and
> said something like "$23.42 please."  She was surprised to see that I was
> already standing there with $23.42 in my hand.  "How did you do that" she
> asked.  She must have thought it was a magic trick.

I was just in a clothing store this weekend and there was a rack of
clothes that was 50%. The sales clerk said everything on that rack was
an additional 25% off, so it's 75% off the original price. I asked is
it 75% off the original price or 25% off the 50% of the price. Said
it's the same thing. I said no it's not. She insisted it was. I said
no, let's take a simple example. If it was $100 and it was 75% off it
would be $25. But if it's 50% off and then 25% off that it will be
$37.50. She looked totally dumbfounded.
-- 
https://mail.python.org/mailman/listinfo/python-list


  1   2   >