Re: EuroPython 2017: Videos for Monday available online

2017-09-28 Thread Terry Reedy
* http://europython.tv/ Mark-Andre, I clicked the link, which forwards to https://www.youtube.com/c/EuroPythonConference and clicked the EuroPython 2017 playlist, and 90% of the 163 videos are unviewable [Private video]s. -- Terry Jan Reedy -- https://mail.python.org/mailman

Re: EuroPython 2017: Videos for Monday available online

2017-09-28 Thread Terry Reedy
nd. That would make it easier to see what is available not. I gave up trying to scroll through the list. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Textwrap doesn't honour NO-BREAK SPACE

2017-09-28 Thread Terry Reedy
s on 2.7, 3.5, 3.6, 3.7. Actual result in Python 3.5 and older: Lorum ipsum dolor sit amet, consectetur adipiscing elit ZZZ ZZZ sed do euismod tempor incididunt ut labore et dolore magna aliqua. I'm pretty sure this is a bug. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Textwrap doesn't honour NO-BREAK SPACE

2017-09-29 Thread Terry Reedy
On 9/29/2017 2:35 AM, Steve D'Aprano wrote: On Fri, 29 Sep 2017 03:55 pm, Terry Reedy wrote: Expected result: Lorum ipsum dolor sit amet, consectetur adipiscing elit ZZZ ZZZ sed do euismod tempor incididunt ut labore et dolore magna aliqua. On Windows 10, I get this on 2.7, 3.5, 3.6

Re: F5 not working?

2017-10-03 Thread Terry Reedy
in which case, you should be able to change it back. If it says F5, which is perhaps what you meant above, and F5 does not work, then you might have changed your keyboard, outside of IDLE, so that it does not generate the expected keycode. Have you rebooted? Any suggestions? It was nice

Re: The "loop and a half"

2017-10-03 Thread Terry Reedy
processing the objects. While loop raret in Python as they are only needed for other patterns, such as 'while mutable object is not in the state we want: modify some more', and the number of modifications needed is not necessarity known ahead of time. -- Terry Jan Reedy -- https:/

Re: The "loop and a half"

2017-10-04 Thread Terry Reedy
do_something_with(data) Perhaps the socket module needs an update to make the boilerplate generator function a method, such as 'iterread'. The separation lets one write source-agnostic processing functions. def do_something(source): for data in source: One can now 'd

Re: Introducing the "for" loop

2017-10-06 Thread Terry Reedy
to Python, that is specifically a Python class. It is not just a function. It is a function that returns an instance of itself when called. This is the distinguishing feature of classes as functions (callables). -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]

2017-10-06 Thread Terry Reedy
rs through event streams rather than character streams. (Note that terminal escape sequences are character-encoded events.) That is why automating a GUI usually requires a special program than can generate and inject events into the event queue read by the GUI program. -- Terry Jan Reedy --

Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]

2017-10-07 Thread Terry Reedy
he lead developer personally doesn't use, because "nobody uses that". https://www.jwz.org/doc/cadt.html -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Introducing the "for" loop

2017-10-07 Thread Terry Reedy
unction' makes some sense is when it means 'range is not *just* a function'. This is akin to when 'people are not animals' means 'people are not (or should not be) *just* animals'. Do people speaking other than English say subcategory Y of category X is special by saying 'Ys are not Xs'? -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: The "loop and a half"

2017-10-07 Thread Terry Reedy
DLE's shell quits on ^D at a prompt on all systems. (This became true before I worked on IDLE.) Clicking the [X] button should close any window on all systems. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: IDLE help.

2017-10-08 Thread Terry Reedy
t the option to install tkinter and IDLE? How are you trying to run IDLE? Do you know what Command Prompt and a console are? -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to globally set the print function separator?

2017-10-09 Thread Terry Reedy
print def print(*args, **kwargs): _print(*args, {'sep':''}.update(kwargs)) -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: about 'setattr(o, name, value)' and 'inspect.signature(f)'

2017-10-10 Thread Terry Reedy
me callables may not be introspectable in certain implementations of Python. So 'some' is a gradually shrinking set. > For example, in CPython, some built-in functions defined in C > provide no metadata about their arguments. this is depends on implementation, so I ask for

Re: Unable to run pip in Windows 10

2017-10-11 Thread Terry Reedy
. This v.1900 was downloaded from python.org? MSC v.1900 is the latest Microsoft C compiler, which was used to compile the binary. It is not downloaded. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Unable to run pip in Windows 10

2017-10-11 Thread Terry Reedy
- What exactly happens when you try? Windows error message: "This app can't run on your PC" -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: how to read in the newsreader

2017-10-16 Thread Terry Reedy
see that I am posting via gmane. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: why del is not a function or method?

2017-10-17 Thread Terry Reedy
tement and avoid surprising the programmer by giving the del function super-powers that no other function has? Tcl does not use parentheses for function calls. But with only one syntax, it still needs arcane quoting rules. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: multiprocessing shows no benefit

2017-10-17 Thread Terry Reedy
ing maxed out and results in a regular map time. How can I use pool.map better? Try following the doc and see what happens. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Can't find latest version of 3.4.x on download page

2017-10-18 Thread Terry Reedy
These are security releases, mainly for servers and people who would compile themselves. Version 3.4.4 is the last version with Windows installers. Correct. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: How to debug an unfired tkinter event?

2017-10-19 Thread Terry Reedy
. >>> import tkinter as tk >>> r = tk.Tk() >>> b = tk.Button(r) >>> b >>> b2 = tk.Button(r) >>> b2 -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: How to debug an unfired tkinter event?

2017-10-19 Thread Terry Reedy
On 10/19/2017 11:28 PM, jf...@ms4.hinet.net wrote: Terry Reedy於 2017年10月20日星期五 UTC+8上午7時37分59秒寫道: On 10/19/2017 5:07 AM, jf...@ms4.hinet.net wrote: I got some info below each time when I squeeze the table: . .5006 .5006.50712528 .5006.50712496 .5006.50712464 .5006.50712144

Re: How to debug an unfired tkinter event?

2017-10-21 Thread Terry Reedy
On 10/21/2017 1:25 PM, jf...@ms4.hinet.net wrote: Terry Reedy at 2017-10-20 UTC+8 AM 7:37:59 wrote: On 10/19/2017 5:07 AM, jf...@ms4.hinet.net wrote: I got some info below each time when I squeeze the table: . .5006 .5006.50712528 .5006.50712496 .5006.50712464

Re: IDLE doesn't recognise installed packages

2017-10-23 Thread Terry Reedy
E in use. It is possible that you have more than one binary around, but I cannot tell from here. To make sure you are running pip with the same binary as IDLE, enter path-to-binary -m pip instance, on windows, given the above path> C:\Programs\Python37\python.exe -m pip list -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Let's talk about debuggers!

2017-10-25 Thread Terry Reedy
ing you the next line. I'll go back to not even touching IDLE with a ten-foot pole now. Do as you want, but please report accurately. There are bugs around the debugger, but not, that I know of, the one you claim. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: IDLE doesn't recognise installed packages

2017-10-26 Thread Terry Reedy
path-to-binary -m pip Your path-to-binary appears to be C:\Users\Daniel86\AppData\Local\Programs\Python\Python36\python.exe You should be able to replace that with py -3.6 but try py -3.6 -c "import sys; sys.executable" to be sure. Terry Reedy hat am 24. Oktober 2017 um 08:3

Re: replacing `else` with `then` in `for` and `try`

2017-11-02 Thread Terry Reedy
ot repeat myself for the fourth or fifth time. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: A use-case for for...else with no break

2017-11-02 Thread Terry Reedy
7;') ... abc>>> IDLE adds \n if needed, so prompts always starts on a fresh line. >>> for x in 'abcdefgh': print(x, end='') abcdefgh >>> "For ... else" to the rescue! py> for char in "abcdefgh": ... print(char, end='') ... else: ... print() ... abcdefgh py> -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: FW: Reading a remove csv file

2017-11-02 Thread Terry Reedy
lines = strgen(link, 'utf-8') reader = csv.DictReader(lines) # plus any other args for row in reader: process(row) Iterators are intended to be chained together like this. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: A use-case for for...else with no break

2017-11-02 Thread Terry Reedy
On 11/2/2017 8:53 PM, Steve D'Aprano wrote: On Fri, 3 Nov 2017 09:20 am, Terry Reedy wrote: This seems like a bug in how Python interacts with your console. On Windows, in Python started from an icon or in Command Prompt: >>> for c in 'abc': print(c, end='

Re: python3 byte decode

2017-11-03 Thread Terry Reedy
>>> a = 1 >>> b = 1 >>> a is b True >>> a = 1000 >>> b = 1000 >>> a is b False For CPython, 'small' ints are cached on startup. Ditto for 'small' strings, which I think includes all 128 ascii chars, and maybe latin1 cha

Re: [TSBOAPOOOWTDI]using names from modules

2017-11-04 Thread Terry Reedy
tch from tk to ttk versions of widgets. Moving, for instance, 'Button' from the tkinter list to the tkinter.ttk list, instead of changing prefixes, would be both easy and make it obvious, at the top, that the change had been made, and for all Buttons. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Mailing list moderators

2017-11-05 Thread Terry Reedy
:  https://mail.python.org/mailman/listinfo/python-list and subscribe, and see if things seem better than the newsgroup. Or point your newsreader to news.gmane.org group gmane.comp.python.general, which mirrors python-list. Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: How to modify this from Python 2.x to v3.4?

2017-11-11 Thread Terry Reedy
self.print_header() print >>self.file print(file=self.file) # print blank line self.print_preamble() print >>self.file self.print_loader() print >>self.file ... ... --Jach -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Windows - py363 crashes with "vonLöwis.py"

2017-11-15 Thread Terry Reedy
? Anyway, for the obvious interpretation of the message, given f:/python/a/vonLöwis.py containing 'print("works")'" C:\Users\Terry>py -3.6 f:/python/a/vonLöwis.py works -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Windows - py363 crashes with "vonLöwis.py"

2017-11-16 Thread Terry Reedy
thon.org/3/reference/lexical_analysis.html#string-and-bytes-literals , by using \u, \U, and \N{name} escape sequences in string literals. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Should constants be introduced to Python?

2017-11-16 Thread Terry Reedy
s during compiling, instead of when running. For instance "n = 10 + 3' will run as 'n = 13', and "for lang in ('C', 'Java', 'Python') will have the tuple pre-computed (whereas "for lang in ['C', 'Java', 'Python] w

Re: connect four (game)

2017-11-24 Thread Terry Reedy
ts as you wrote code, write a test file now. It will probably be at least as long as your current file. You will learn a lot about your code by doing so. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Benefits of unicode identifiers

2017-11-24 Thread Terry Reedy
s to use a 'crappy ASCII text editor' for such code. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Issues encountered while launching the IDLE of python 3.7 64-bit I downloaded recently.

2017-11-24 Thread Terry Reedy
ptions I don't know what this means. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: connect four (game)

2017-11-25 Thread Terry Reedy
On 11/24/2017 9:05 PM, namenobodywa...@gmail.com wrote: On Friday, November 24, 2017 at 12:13:18 PM UTC-8, Terry Reedy wrote: Since you did not start with tests or write tests as you wrote code, ... that I could tell ... I agree that I should have stuck in a qualifier, such as 'appar

Re: connect four (game)

2017-11-25 Thread Terry Reedy
On 11/25/2017 4:57 PM, namenobodywa...@gmail.com wrote: On Saturday, November 25, 2017 at 12:48:38 AM UTC-8, Terry Reedy wrote: I did, and it looks buggy to me. The top and left frame lines are missing. If I click a square, the bottom square in the column lights up. But then I have no idea

Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-25 Thread Terry Reedy
want to seriously work with unicode, many recommend using modern Python. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: asyncio loop.call_soon()

2017-11-28 Thread Terry Reedy
as actually called twice: first for task_func(), and then for callback. I believe that this means that any code in the coroutine *before* the first await is run immediately. This is what I experienced in my experiments yesterday. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: How to use a regexp here

2017-12-04 Thread Terry Reedy
ticular 4.7. As for your idea of an RE, '^' matches the beginning of a line, and '$' the end, though using .startswith, and .endswith, are easier if no other RE syntax is needed for matching. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: why won't slicing lists raise IndexError?

2017-12-04 Thread Terry Reedy
et' versus 'if len(s) >= k+1 and s[k] in okset'. There are many examples like this where is slicing did not clamp, the user would have to reproduce some of the logic done by slices. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: why won't slicing lists raise IndexError?

2017-12-06 Thread Terry Reedy
_getitem__ method that implements stricter slicing for instances of a custom class. I think we have collectively answered the OP's question quite well. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: we want python software

2017-12-06 Thread Terry Reedy
arefully read what version you need to install for your OS. 5. Apply the acquired knowledge and download the appropriate version. 6. Click on the installer (if on Windows). 7. Follow all the prompts. 8. Enjoy. but this is too much for the tech student. Thank you. -- https://mail.python.org/mailm

Re: How to use a regexp here

2017-12-08 Thread Terry Reedy
ry Reference chapters 2, 3, 4 and in particular 4.7. As for your idea of an RE, '^' matches the beginning of a line, and '$' the end, though using .startswith, and .endswith, are easier if no other RE syntax is needed for matching. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-12-09 Thread Terry Reedy
f non-english versions aimed at schoolkids. The cpython core developer group has nothing to do with such. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Python homework

2017-12-13 Thread Terry Reedy
first function is the one wanted, one could feed choices into a counter. (The import should be outside of the function.) def rollDie(number): rolls = [0] * 6 for i in random.choices((0,1,2,3,4,5), k=number): rolls[i] += 1 return rolls -- Terry Jan Reedy -- https

Re: Can't start IDLE on mac os x high sierra can't import Tkinter

2017-12-15 Thread Terry Reedy
You should probably specify rather exactly what you did. There are multiple issues on bugs.python.org and questions on stackoverflow. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Learning

2017-12-16 Thread Terry Reedy
know of two ways to do so. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: correctness proof for alpha-beta algorithm

2017-12-18 Thread Terry Reedy
On 12/19/2017 1:01 AM, namenobodywa...@gmail.com wrote: can anybody tell me where to look for a proof of the correctness of a minimax/negamax algorithm with alpha-beta pruning? thanks if you can help Where or how have you looked so far? How formal do you want? -- Terry Jan Reedy -- https

Re: How to edit a function in an interactive python session?

2017-12-21 Thread Terry Reedy
. It is also possible to edit multi-line code line-by-line in the standard REPL, but it is more painful and error prone. One can monkey-patch an edited function into an imported module written in Python. The original code can be copied from an editor and pasted into the REPL. -- Terry Jan

Re: Regarding the error: TypeError: can’t pickle _thread.lock objects

2017-12-21 Thread Terry Reedy
ay be monitored. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Using the variable type annotation syntax as a placeholder in a nonlocal scope?

2017-12-22 Thread Terry Reedy
on 3.6 docs. So should I consider this as a bug, or an implementation detail (side effect), or a wart, or a feature? I don't understand the question. Maybe people on SO did not either. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: PyWin32 installer question

2017-12-29 Thread Terry Reedy
pxx wheels for about 300 packages, for 2.7, 3.4, 3.5, 3.6, 3.7, in win32 and win_amd64 versions (as applicable). PyWin32-221 is included, with all combinations. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: tkinter MP working like a charm

2017-12-31 Thread Terry Reedy
root.mainloop() if __name__ == '__main__': async_loop = asyncio.get_event_loop()# all in this loop submain(async_loop) To do everything in the main thread, one can replace 'root.mainloop' with loop.run_forever (in the main thread) and repeated root.update calls. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: tkinter MP working like a charm

2017-12-31 Thread Terry Reedy
On 12/31/2017 8:52 PM, Terry Reedy wrote: To do everything in the main thread, one can replace 'root.mainloop' with loop.run_forever (in the main thread) and repeated root.update calls. Wu Xi's example, rewritten more or less as suggested: from tkinter import * from tkinter im

Scientific Python moving to Python 3 only.

2017-12-31 Thread Terry Reedy
pip installation, and possible support by other (most likely commercial) parties. http://www.python3statement.org/ About 30 other projects, including other part of the python-science stack, have 'pledged' to so something similar. -- Terry Jan Reedy -- https://mail.python.org/mailma

Re: ... (Posting On Python-List Prohibited)

2018-01-01 Thread Terry Reedy
oppression of people who want to use the list, funded by PSF, for its purpose, discussion of Python. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Simple graphic library for beginners

2018-01-11 Thread Terry Reedy
-m pip install xyz where invokes a specific python binary on the particular machine. For example, on Windows 10 with amd64 binaries installed. C:\Users\Terry>py -3.6 -m pip install pygame Collecting pygame Downloading pygame-1.9.3-cp36-cp36m-win_amd64.whl (4.2MB) 100% |███

Re: Simple graphic library for beginners

2018-01-11 Thread Terry Reedy
can't expect that people provide binary installers for Python versions that are alpha. In fact, https://www.lfd.uci.edu/~gohlke/pythonlibs/ does have such for 3.7, 'as is', for the adventurous or the proactive, for perhaps half of 100s of packages covered there. -- Terry Jan R

Re: Simple graphic library for beginners

2018-01-11 Thread Terry Reedy
.exe -m pip install ... On Windows, the easy and recommended way to be 'explicit' is, at worst, 'py -x.y'. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: PSF grant for "Shed Skin" to python 3.x?

2018-01-11 Thread Terry Reedy
of 20+page monstrosity required by the US National Science Foundation. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Where are the moderators?

2018-01-19 Thread Terry Reedy
d news (as opposed to mail) account. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Very strange issues with collections.Mapping

2018-01-19 Thread Terry Reedy
for virtual subclasses. The token changes with every call to ABCMeta.register() on any ABC. """ You could call this before, between, and after all your imports, and add such calls to the guilty import. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Can't get python running

2018-01-20 Thread Terry Reedy
modify, restore, or uninstall. The only time that should pop up is when you rerun the installer instead of the installed binary. (Or when you invoke it from the installed programs control panel.) *Exactly* how are you trying to run the installed Python. What version of Windows? -- Terry Jan

Re: Please help on print string that contains 'tab' and 'newline'

2018-01-27 Thread Terry Reedy
[Ljava.lang.Object; does not exist* *at com.livecluster.core.tasklet IDLE ignores \r, other display mechanisms may not. You generally should not use it. Pasting the text, with the literal newline embedded, does not work in Windows interactive interpreter, so not testing this there. -- Te

Re: Sentiment analysis using sklearn

2018-01-27 Thread Terry Reedy
time error. In order for the 'bot' to classify new samples, by learning the difference between positive and negative samples, it needs to be trained on existing samples that are 'correctly' classified. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Terry Reedy
I won't use it for this list ;-), but an image of the MS Error box might be helpful occasionally on the tracker. In Win10 Command Prompt, selection now works more of less normally, so that excuse is gone. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: python not working

2018-01-29 Thread Terry Reedy
ython are built with a proprietary compiler that requires a separate download. They are build with the standard VS2017 compiler. The new .dll is an update for pre-Win10 and probably early Win10, but some people block updates and don't manually request needed one's like this. --

Re: Import statements and multiprocessing

2018-01-30 Thread Terry Reedy
still have a problem. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Fwd: Syntax error

2018-02-03 Thread Terry Reedy
trackback. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Fwd: Syntax error

2018-02-03 Thread Terry Reedy
On 2/3/2018 3:38 PM, bob gailer wrote: On 2/3/2018 2:40 PM, Terry Reedy wrote: On 2/3/2018 2:10 PM, Kevin Doney wrote: Hi. *pip3 install --upgrade tensorflow-gpu* When I try the above command I get SyntaxError: invalid syntax Please help. This group helps those who help the group -- by

Re: 3.6.4 IDLE

2018-02-04 Thread Terry Reedy
is likely. I suggest the 'executable' versus the 'web-based' installer, as one can read something else while downloading (less than a minute), and one will have the installer to repair or revise, but that is up to you. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Why no '|' operator for dict?

2018-02-05 Thread Terry Reedy
tionary, but it does not work - If you know keys are unique or you want keep the second value for a duplicate (equal) key, >>> d1 = {1: 'one', 2: 'two'}; d2 = {3: 'three', 1:'One'} >>> d3 = d1.copy() >>> d3.update(d2) >>> d3 {1: 'One', 2: 'two', 3: 'three'} -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: libxml2 installation/binding issue with Python 3.6.4

2018-02-05 Thread Terry Reedy
rify_fd I would try re-installing libxml2 *once* and then look for a package support list or email. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Old format with %

2018-02-14 Thread Terry Reedy
uot; % 7 + "%" 'test 7%'  # OK But is there a way to escape a % ? thx Found, double % to escape it >>>"test %d%%" % 7 'test 7%' Same with { and } in new format and f strings. >>> a = 3 >>> f'{{x:{a}}}' '{x:3}' -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-17 Thread Terry Reedy
le to upgrade and follow best practice. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-19 Thread Terry Reedy
ne Fortran int = four chars.) The C memory model is a linear sequence of bytes, each consisting of at least 8 bits. One means for malware attacks it is to disguise and insert binary code bytes as character bytes and then trick the CPU into executing the 'characters'. -- T

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-20 Thread Terry Reedy
ete input types. "array of x" gives an indefinite number more, as does user additions. I really like that we do not have to define a 'min_collection_type' function for every combination we might want to use in a package. When makes people recoil is abusing dynamism by needl

Re: could use some help with this problem! (Posting On Python-List Prohibited)

2018-02-20 Thread Terry Reedy
*any* explicit loops. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-21 Thread Terry Reedy
On 2/21/2018 3:15 AM, Antoon Pardon wrote: On 21-02-18 06:18, Terry Reedy wrote: On 2/20/2018 8:38 AM, Antoon Pardon wrote: People praise the dynamic nature of Python here on this list and then often enough seem to recoil when they see a piece of code really using that dynamism. ... When

Re: How to make Python run as fast (or faster) than Julia

2018-02-22 Thread Terry Reedy
lated. The idea of naively implementing the recursive definition, in any non-trivial practical situation, without saving intermediate values, is pretty ludicrous. Fib can be viewed as a function on a directed graph where all but the 2 base nodes have two incoming and two outgoing edges. --

Re: How to make Python run as fast (or faster) than Julia

2018-02-23 Thread Terry Reedy
7;ComplexWarning', ... 'vstack', 'warnings', 'where', 'who', 'zeros', 'zeros_like'] So, given a realistic number-crunching benchmark that take at least several minutes, one could add those two lines at the top and be off -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: How to make Python run as fast (or faster) than Julia

2018-02-23 Thread Terry Reedy
On 2/23/2018 11:32 AM, Python wrote: On Fri, Feb 23, 2018 at 03:11:36AM -0500, Terry Reedy wrote: Why do you care about the 50 million calls? That's crazy -- the important thing is *calculating the Fibonacci numbers as efficiently as possible*. If you are writing practical programs, t

Re: matrix multiplication

2018-02-25 Thread Terry Reedy
' matrix multiply operator. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Questions about `locals` builtin

2018-02-26 Thread Terry Reedy
the class statement finishes, the local names become class attributes. Be default, function local namespaces in CPython are implemented as arrays, with local names compiles as indexes in the array. Calling surrounding function local names collectively 'nonlocals' is the result of

Re: Detection of ultrasonic side channels in mobile devices with Python?

2018-02-28 Thread Terry Reedy
about *real* ultrasound, well away from the audio range. So this seems to be a completely separate topic. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: csv module and NULL data byte

2018-02-28 Thread Terry Reedy
elegant in that is cleans the input stream independently of the consumer. It is easier than what I was going to suggest, which is to read the cvs source for the line that raises the exception and modify the code until it works with \0 in the stream. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Ways to make a free variable local to a function?

2018-03-05 Thread Terry Reedy
arguments) and can not be changed inside the function scope. With kind regards, -gdg -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Ways to make a free variable local to a function?

2018-03-05 Thread Terry Reedy
On 3/5/2018 9:34 AM, Chris Angelico wrote: On Tue, Mar 6, 2018 at 12:52 AM, Terry Reedy wrote: On 3/5/2018 7:12 AM, Kirill Balunov wrote: # 1. By passing through local variable's default values def func_local_1(numb, _int = int, _float = float, _range = range): You are not req

Re: [python-committers] [RELEASE] Python 3.11 release candidate 1 (3.11.0rc1) is available

2022-08-08 Thread Terry Reedy
On 8/8/2022 12:59 PM, Pablo Galindo Salgado wrote: Python 3.11.0 is almost ready. This release, 3.11.0rc1, is the penultimate release preview. You can get it here: ## This is the first release candidate of Python 3.11 https://www.python.org/downloads/release/python-3110rc1/

Re: Writing a Python3 ttk.Notebook

2021-01-15 Thread Terry Reedy
Lib/idlelib/configdialog.py. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: HEKLP

2021-01-15 Thread Terry Reedy
it. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Python not Running

2021-01-16 Thread Terry Reedy
e the same message. Can anyone help me with this? You can also read answers to similar posts at https://mail.python.org/pipermail/python-list/ -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: A beginning beginner's question about input, output and . . .

2021-01-16 Thread Terry Reedy
you do not need that, for line in f: is sufficient for iterating thru the file line by line. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

<    8   9   10   11   12   13   14   15   16   17   >