Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Paul Moore
to it. In Python, variables aren't declared, and constness is an inherent property of the value (or its type). One interesting question which this does raise is whether there's a place for "const" in type annotations - I suspect not, because it's either trivial (the ty

Re: Return str to a callback raise a segfault if used in string formating

2017-10-14 Thread Paul Moore
On 14 October 2017 at 16:06, Vincent Vande Vyvre wrote: > I think I've found the problem, the string (a file path) is modified in c > with "sprintf, snprintf, ..." And I plan to change that with some CPython > equivalent function. Nice :-) Glad you found it. Paul --

Re: how to read in the newsreader

2017-10-16 Thread Paul Moore
stallations. And gmane's UI sucks. For that situation, reading mailing lists as mails in gmail is the best option I've been able to find (not ideal, but adequate). Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: how to read in the newsreader

2017-10-16 Thread Paul Moore
On 16 October 2017 at 16:07, Grant Edwards wrote: > On 2017-10-16, Paul Moore wrote: >> Unless you work regularly on multiple PCs, as there's no newsreader I >> know of that maintains your settings (what articles you have read, in >> particular) across multiple ins

Re: Application and package of the same name

2017-10-19 Thread Paul Moore
quot;. It's not a pattern I've seen commonly used. However, the approaches I've seen used (a __main__.py inside the package, so you can execute it via `python -m fribble`, or a setup.py entry point to generate a script wrapper for the application) may be more common among people fo

Re: Compression of random binary data

2017-10-23 Thread Paul Moore
bytes you propose to use? Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Compression of random binary data

2017-10-23 Thread Paul Moore
rguments conjecture...not laws. No-one is going to accept a claim that an algorithm you're not willing to publish is valid. This is about maths/science, not "proprietary algorithms" or anything like that. If you don't publish your methods, people will simply point at information theoretic proofs and say "either you're missing something, or your approach doesn't work in cases that I care about, so thanks but no thanks". Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Compression of random binary data

2017-10-24 Thread Paul Moore
On 24 October 2017 at 09:43, Gregory Ewing wrote: > Paul Moore wrote: >> >> But that's not "compression", that's simply using a better encoding. >> In the technical sense, "compression" is about looking at redundancies >> that go beyond th

Re: Compression of random binary data

2017-10-24 Thread Paul Moore
mpressions it takes to hit 0 bytes. Because you decrease the size every time, though, that number must be no greater than the size of the original file). Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Compression of random binary data

2017-10-24 Thread Paul Moore
On 24 October 2017 at 12:04, Ben Bacarisse wrote: > Paul Moore writes: > >> On 24 October 2017 at 11:23, Ben Bacarisse wrote: >>> For example, run the complete works of Shakespeare through your program. >>> The result is very much not random data, but that's

Re: Let's talk about debuggers!

2017-10-26 Thread Paul Rubin
Terry Reedy writes: > On Windows, [IDLE] uses native widgets when possible... > In summary, I think debugger should rate at least 'good' rather than > fail' when it comes to showing you the next line. I actually like how the Tk widgets look. I've done some semi-industrial applications with tkint

Re: SciPy 1.0 released!

2017-10-27 Thread Paul Dubois
who writes software knows that what they do is ephemeral, but I don’t want history to be lost so soon. Paul Dubois ... moving as we speak to La Mesa, CA On Wed, Oct 25, 2017 at 5:05 AM Ralf Gommers wrote: > Hi all, > > We are extremely pleased to announce the release of SciPy 1.0,

Re: install on host not connected to the internet and no local proxy

2017-11-02 Thread Paul Moore
copy that directory to the target machine and (assuming the two machines do have the same architecture/OS) on that machine do pip install --no-index --find-links wheels -r requirements.txt This will tell pip to not use PyPI (and so not need the internet) and to satisfy the requirements using only the wheel files in the "wheels" directory. Paul -- https://mail.python.org/mailman/listinfo/python-list

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

2017-11-02 Thread Paul Rubin
Steve D'Aprano writes: > for x in something(): > print(x, end='') print(''.join(something())) -- https://mail.python.org/mailman/listinfo/python-list

Re: [TSBOAPOOOWTDI]using names from modules

2017-11-05 Thread Paul Moore
l taste. Also, if what you are trying to "do" is different (for example, you're trying to write code that looks familiar to mathematicians) the obvious way may be different too (so "from math import cos" may be the obvious approach in that situation). But regardless, the Zen isn't intended to be taken quite as literally as the OP was trying to do. It's a statement of principles, not a set of rules. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Read Firefox sqlite files with Python

2017-11-05 Thread Paul Moore
ould > just dump a big ball of mud into it? Hmm, *.sql files normally contain SQL source code (as this one does). SQLIte databases in my experiences typically use either ".sqlite" or ".db" for the extension. Are you sure you're looking at the right file? Alternatively I g

Re: [TSBOAPOOOWTDI]using names from modules

2017-11-05 Thread Paul Moore
On 5 November 2017 at 13:54, Stefan Ram wrote: > Paul Moore writes: >>But regardless, the Zen isn't intended to be taken quite as literally >>as the OP was trying to do. It's a statement of principles, not a set >>of rules. > > What I am looking f

Re: Easiest way to access C module in Python

2017-11-07 Thread Paul Moore
OP is cffi, which might offer a middle ground (in terms of complexity vs power - it's hard to objectively assess "complexity" without knowing the audience's background). Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: What happens to module's variables after a "from module import" ?

2017-11-07 Thread Paul Moore
> > > it works > >>>> test() > > 0 >>>> >>>> test() > > 1 > > But where variable "a" is located ? I can't find it anywhere It's in the "tmp" module, where you defined it. But because you didn't ask fo

Re: Any good explanations on pd.merge(df,df2, on=['Code', 'Region'])

2017-11-08 Thread Paul Moore
ient for you, please provide a better explanation of what you don't understand, what you have tried and how it didn't match your expectations, and maybe someone on the list who is familiar with Pandas will be able to assist you. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Ideas about how software should behave

2017-11-09 Thread Paul Moore
the other person appears to be taking it. It's about accepting that the other person took your words in a particular way, and acknowledging and dealing with the fact that their interpretation is real to them, and should not be dismissed as "mistaken". Paul [1] https://www.python.or

Re: can't get python to run

2017-11-12 Thread Paul Moore
may be that you simply haven't updated recently. But the manual install will work just as well. Hope this helps, Paul PS The reason Python 2.7 works, is that it uses an older version of Visual C, which doesn't need the newer runtime installed. -- https://mail.python.org/mailman/listinfo/python-list

Re: "help( pi )"

2017-11-17 Thread Paul Moore
t; > from math import pi > help( pi ) math.pi is not "a class method, or function within a module or module in a package". It's a number. I can see why you would want to be able to do this, but technically the help function shows the object's docstring, and

Re: "help( pi )"

2017-11-17 Thread Paul Moore
On 17 November 2017 at 15:52, Marko Rauhamaa wrote: > Paul Moore : >> numbers don't have docstrings. > > There's no reason they couldn't: In the sense that the Python object model could be amended to attach docstrings to instances of classes like "int", a

Re: reading text in pdf, some working sample code

2017-11-21 Thread Paul Moore
ng more detail as to what your problem is. Paul On 21 November 2017 at 15:18, Daniel Gross wrote: > Hi, > > I am new to python and jumped right into trying to read out (english) text > from PDF files. > > I tried various libraries (including slate) out there but am running

Re: Increasing the diversity of people who write Python (was: Benefits of unicode identifiers)

2017-11-27 Thread Paul Moore
not this one, but I'll try to remember to post the name tomorrow... Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Pros and cons of Python sources?

2017-11-27 Thread Paul Moore
l with the fact that something like that is what you should do if you find a problem you can't resolve yourself and need to ask for help from upstream (e.g., your distro provider or the pip maintainers). It's not so much that anyone's forcing you to do anything a particular way - just setting the boundaries on what they are willing to support if you need help. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Increasing the diversity of people who write Python (was: Benefits of unicode identifiers)

2017-11-28 Thread Paul Moore
On 27 November 2017 at 19:05, Paul Moore wrote: > On 27 November 2017 at 18:13, Skip Montanaro wrote: >>> If you have a Windows key, you can assign it to be >>> the Compose key. >> >> Would this be true on a machine running Windows? My work environment >

Re: [OT] - Re: Has anyone worked on docker with windows

2017-11-30 Thread Paul Moore
rs". From a very quick Google search, it looks like there is support for running Windows-based containers in docker now. There's an image microsoft/windowsservercore available, which suggests this is a supported solution. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: How to get the redirected URL only but not the actual content?

2017-12-02 Thread Paul Moore
th=/ Set-Cookie: TS01d430e1=012f3506230b0f867dbbdc2d8cd9812cc6cda6004b86d26e43e83dddc173810cbaa92efa00939a6282cc7ad5b9b80ddea276f6b5409df42e43a52ed561e1234df4ab341c2f3974c06b59548aab1e30a871ec4efc9bba1a756faf9076574ae4a4f67b57fa79856f016141e55bb9497d8dc4bbd4037c; path=/; domain=ieeexplore.ieee.org Transfer-Encoding: chunked Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: why won't slicing lists raise IndexError?

2017-12-04 Thread Paul Moore
stop, stride) Assuming a sequence of length len, calculate the start and stop indices, and the stride length of the extended slice described by S. Out of bounds indices are clipped in a manner consistent with the handling of normal slices. Using indices(), you'll get (from "

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Paul Moore
ee https://en.wikipedia.org/wiki/Identity_function identity(1,2) is an error. Extending the definition to multiple arguments causes all sorts of confusion, as you've seen. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Paul Moore
: return arg" could be a useful dummy function in some contexts, for example - but it's not an identity function in the strict sense (and so you can't avoid having to specify its behaviour explicitly). Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Problem with timeit

2017-12-15 Thread Paul Moore
ual measurements match what I'd expect given results of timeit/time.time whereas yours don't...). Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: PyWin32 installer question

2017-12-28 Thread Paul Moore
heel - you may need to ask the project maintainers for advice. Paul On 27 December 2017 at 14:58, Skip Montanaro wrote: > I'm fiddling around with Appveyor, trying to build a Windows installer > for SpamBayes. This is complicated by two facts: > > 1. I don't know s

Re: PyWin32 installer question

2017-12-28 Thread Paul Moore
ing to find Windows binaries for Python packages :-( I'd strongly recommend moving to Python 3, as the situation is immensely improved there - most projects ship Python 3 binary wheels, and "pip install" just works in many cases. But I appreciate that doesn't help much for you. Sorry - hopefully one of the other options above will help. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: PyWin32 installer question

2017-12-29 Thread Paul Moore
m with a Python 2.x build environment on it, I can see if I can do a 64-bit build for you. Ping me if that would be a help. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Numpy and Terabyte data

2018-01-02 Thread Paul Moore
look at Dask (https://pypi.python.org/pypi/dask, docs at http://dask.pydata.org/en/latest/). I've not used it myself, but I believe it's designed for very much the sort of use case you describe. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Progress migrating cffi and pycparser to libclang

2018-01-04 Thread Paul Moore
repo in your apt." but doesn't provide binaries or explain how to install clang on, say, Windows (to pick an example relevant to me :-)). As a fork/extension for cffi, I have no particular opinion (I'm unlikely to ever use it). But the advantage of pycparser is that it's cr

Re: Progress migrating cffi and pycparser to libclang

2018-01-04 Thread Paul Moore
imately if you're proposing this as a change to cffi, you should be getting the opinions of the cffi devs, not just asking on this list. (I notice you have posted to the cffi mailing list, but haven't had any response yet). Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-09 Thread Paul Moore
ger that error!) > > Have fun with it! In addition to Chris' suggestions, it would probably be good to look at the documentation - the "Extending and Embedding" and "Python/C API" manuals, although focused more on people writing C code to interface with Python, never

Re: Pandas printing in jupyter

2018-01-11 Thread Paul Moore
module pandas.core.frame: _repr_html_() method of pandas.core.frame.DataFrame instance Return a html representation for a particular DataFrame. Mainly for IPython notebook. >>> Paul On 11 January 2018 at 04:23, Rustom Mody wrote: > If I make a data-frame in pandas in jupyter notebook it prints

Re: PIP message: Fatal error in launcher: Unable to create process using '"'

2018-01-11 Thread Paul Moore
ip you're (currently) using which give the error. Also, please confirm that you get the same errors if you're in a different (empty) directory - sometimes what's in the current directory can mess things up. Paul On 11 January 2018 at 14:39, Harriett Xing wrote: > I am getting

Re: PIP message: Fatal error in launcher: Unable to create process using '"'

2018-01-11 Thread Paul Moore
Glad it's working for you. You don't say where your pip.exe command is located, but I suspect what's happening is that you're picking up a pip.exe from an old and since uninstalled copy of Python. But at least you can use pip now which is the main thing :-) Paul On 11 J

Re: Simple graphic library for beginners

2018-01-11 Thread Paul Moore
uation that has been resolved for a year or more is fairly dismissive of the huge amount of work that a lot of people have put in, free of charge, to improve Python's packaging ecosystem over the last few years. Paul [1] If you were buying a new graphics card for your PC, would you rel

Re: Simple graphic library for beginners

2018-01-11 Thread Paul Moore
#x27;t been released yet. OF COURSE you will hit problems. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Simple graphic library for beginners

2018-01-12 Thread Paul Moore
and did "pip install numpy", successfully and without help from me. Sure, some beginners have issues, but they are usually willing to be helped. To be as aggressively resistant to the simplest suggestions the way you're being isn't the behaviour of a beginner in my experience. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Simple graphic library for beginners

2018-01-12 Thread Paul Moore
han report the tracebacks produced (we tried trimming junk and summarising, and got lots of complaints about hiding the causes of problems). But pip's error reporting isn't wonderful. We do tend to spew out tracebacks rather than user-friendly messages. It's usually easy enough to work out what the common tracebacks mean, but they are still an intimidating wall of text to a non-expert. The usual "contributions accepted" applies here, as pip developer time is extremely limited, but it's not going to be an easy task for anyone. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Simple graphic library for beginners

2018-01-12 Thread Paul Moore
only thing and I don't really understand the reasons, but it's why I'm a fan of the "python -m pip" approach. There's discussion on the pip tracker if you're interested enough to go searching - I know it's something that's been debated, but I don't recall the context. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Simple graphic library for beginners

2018-01-12 Thread Paul Moore
On 12 January 2018 at 09:12, Tim Golden wrote: > I think the shame here is that there is a learning opportunity on both > sides. As Paul says: by and large, the huge amount of work which the Python > Packaging team, especially the pip developers, have put in has paid off. > It&#

Re: Simple graphic library for beginners

2018-01-12 Thread Paul Moore
pip" or "py -3.6 -m pip" as required. Works now, no hassle. You still have to install pip (the package, not the executable) in each Python home, but that's just how Python packages work (and pip is already installed by default when you install Python on Windows anyway). Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Where are the moderators?

2018-01-18 Thread Paul Moore
- https://mail.python.org/mailman/listinfo/python-list) Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Can't get python running

2018-01-21 Thread Paul Moore
ns to do with the precedence of the user and system parts of the PATH variable (which are important, but that's not much help to people who wish that after you installed Python, typing "python" at the command prompt would just work...) Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Installing "kitchen" module

2018-01-22 Thread Paul Moore
You need to run that command from a CMD prompt, not from inside the Python interpreter. On 22 January 2018 at 16:19, wrote: > On Tuesday, 23 January 2018 02:41:04 UTC+10:30, [email protected] wrote: >> On Monday, January 22, 2018 at 3:37:44 PM UTC, [email protected] wrote: >> > So here's the

Re: Installing "kitchen" module

2018-01-22 Thread Paul Moore
"python -m pip install kitchen" is probably your best approach (from the CMD prompt). On 22 January 2018 at 16:31, wrote: > On Tuesday, 23 January 2018 02:56:56 UTC+10:30, Paul Moore wrote: >> You need to run that command from a CMD prompt, not from inside the >> Pyt

Re: Installing "kitchen" module

2018-01-22 Thread Paul Moore
On 22 January 2018 at 17:20, wrote: > On Tuesday, 23 January 2018 03:41:28 UTC+10:30, Paul Moore wrote: >> "python -m pip install kitchen" is probably your best approach (from >> the CMD prompt). >> >> On 22 January 2018 at 16:31, wrote: >> >

Re: What is more Pythonic: subclass or adding functionality to base class?

2018-02-11 Thread Paul Moore
are created at runtime, and there's no compile-time layout that code needs to depend on, so if you add an extra field to a class, only those parts of your codebase that need the new field have to care. Of course, if this is a public API, backward compatibility and versioning of the API bec

Re: Fw: [issue22167] iglob() has misleading documentation (does indeed store names internally)

2018-02-18 Thread Paul Moore
You're shown as nosy on that issue: 2014-08-08 01:24:52 Gumnos set nosy: + Gumnos Paul On 17 February 2018 at 13:47, Tim Chase wrote: > Has anybody else been getting unexpected/unsolicited emails from the > Python bug-tracker? > > I'm not associated with (didn't sub

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

2018-02-19 Thread Paul Moore
about whether Python is actually strongly typed or not[1], maybe? The reality is that the term "strongly typed" can be made to mean whatever you want it to mean in these debates, and such claims usually turn out to be little more than statements "yah boo my language is better than y

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

2018-02-19 Thread Paul Moore
On 19 February 2018 at 15:18, Ned Batchelder wrote: > On 2/19/18 9:54 AM, Steven D'Aprano wrote: >> >> On Mon, 19 Feb 2018 13:28:26 +, Paul Moore wrote: >> >>> [1] The most basic question, which people making such claims often can't >>> answe

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

2018-02-19 Thread Paul Moore
On 19 February 2018 at 17:11, Ned Batchelder wrote: > On 2/19/18 10:39 AM, Paul Moore wrote: >> >> I'm curious - How would you explain Python's "variables" to someone >> who knows how C variables work, in a way that ensures they don't carry >>

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

2018-02-20 Thread Paul Moore
have different types even in C (it's just variables, or names within a specific scope, that have types associated with them). Summary: Different programming languages have different semantics. Which really isn't that surprising... Paul -- https://mail.python.org/mailman/listinfo/python-list

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

2018-02-20 Thread Paul Moore
On 20 February 2018 at 13:04, Antoon Pardon wrote: > On 20-02-18 13:11, Paul Moore wrote: >> On 20 February 2018 at 11:18, Antoon Pardon wrote: >>> Personnally I would prefer the type system of Pascal and Modula2 with >>> their interval type >>> above a D

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

2018-02-20 Thread Paul Moore
is worse than (some other language) then so what? Probably >> true in some cases, but what makes you think you'll get enthusiastic >> approval for such a statement in a Python group? > > So you only want to see praisal for python? One can't express how one > prefer

Re: Strange problem with pip2

2018-03-01 Thread Paul Moore
versions of pip, so starting with a question on a distro-specific forum might be a good idea. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: RFC: Proposal: Deterministic Object Destruction

2018-03-02 Thread Paul Moore
def fn(): for i in range(1): loop_body(i) That's both less efficient (function calls have a cost) and less maintainable than the with-statement version. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: .0 in name

2022-05-13 Thread Paul Bryan
s.html#identifiers Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: .0 in name

2022-05-13 Thread Paul Bryan
hat is valid identifier syntax. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Non-deterministic set ordering

2022-05-15 Thread Paul Bryan
This may explain it: https://stackoverflow.com/questions/27522626/hash-function-in-python-3-3-returns-different-results-between-sessions On Mon, 2022-05-16 at 04:20 +0100, Rob Cliffe via Python-list wrote: > > > On 16/05/2022 04:13, Dan Stromberg wrote: > > > > On Sun, May 15, 2022 at 8:01 PM R

Re: F-string usage in a print()

2022-05-24 Thread Paul Bryan
Try something like: print(f"Year = {years}, Future value = {future_value}") On Tue, 2022-05-24 at 21:14 +, Kevin M. Wilson via Python-list wrote: > future_value = 0 > for i in range(years): > # for i in range(months): >    future_value += monthly_investment >    future_value = round(future_va

Re: Subtract n months from datetime

2022-06-20 Thread Paul Bryan
min(value.day, calendar.monthrange(year, month)[1])   return date(year, month, day) Paul On Tue, 2022-06-21 at 05:29 +0100, Paulo da Silva wrote: > Hi! > > I implemented a part of a script to subtract n months from datetime. > Basically I subtracted n%12 from year and n//12 from the mo

Re: Which linux distro is more conducive for learning the Python programming language?

2022-08-03 Thread Paul Bryan
I wouldn't say any particular Linux distribution is appreciably better for Python development than another. I would suggest using a version of a Linux distribution that supports a recent Python release (e.g. 3.9 or 3.10). On Thu, 2022-08-04 at 10:22 +0800, Turritopsis Dohrnii Teo En Ming wrote: >

Re: Information about Dying kernel

2022-08-07 Thread Paul Bryan
Have you tried turning it off and back on again? On Sun, 2022-08-07 at 18:59 +0200, nhlanhlah198506 wrote: > Greetings What can I do if my computer said my kernels has died Thank > you Sent from my Galaxy -- https://mail.python.org/mailman/listinfo/python-list

Re: subprocess.popen how wait complete open process

2022-08-21 Thread Paul Bryan
Sometimes, launching subprocesses can seem like punishment. I don't think there is a standard cross-platform way to know when a launched asynchronous process is "fully open" (i.e. fully initialized, accepting user input). On Sun, 2022-08-21 at 02:11 -0700, simone zambonardi wrote: > Hi, I am runni

Re: python 3.10 vs breakage

2022-08-26 Thread Paul Bryan
Why can't you build linuxcnc with it? Why has Octoprint quit talking to 3d printers? Why won't pronterface buy it? Why can't you find a 4.0.7 version of wxPython? Why is it sitting there staring at you? What is bookworm? What is bullseye? On Fri, 2022-08-26 at 16:37 -0400, gene heskett wrote: > Gr

Re: python 3.10 vs breakage

2022-08-26 Thread Paul Bryan
lity.  [1] https://github.com/kliment/Printrun/blob/master/README.md On Fri, 2022-08-26 at 17:36 -0400, gene heskett wrote: > On 8/26/22 16:54, Paul Bryan wrote: > > Why can't you build linuxcnc with it? Why has Octoprint quit > > talking to > > 3d printers? Why won'

Re: Are these good ideas?

2022-11-14 Thread Paul Bryan
Seems like this is a use case for context managers and/or context variables: https://docs.python.org/3/library/contextlib.html https://docs.python.org/3/library/contextvars.html On Mon, 2022-11-14 at 17:14 +, Stephen Tucker wrote: > Hi, > > I have two related issues I'd like comments on. >

Re: set.add() doesn't replace equal element

2022-12-30 Thread Paul Bryan
What kind of elements are being added to the set? Can you show reproducible sample code? On Fri, Dec 30 2022 at 03:41:19 PM -0600, Ian Pilcher wrote: I just discovered this behavior, which is problematic for my particular use. Is there a different set API (or operator) that can be used to a

Re: set.add() doesn't replace equal element

2022-12-30 Thread Paul Bryan
er durable immutable attribute, I would be inclined to make that the dictionary key, and store the DHCP object as the value. On Fri, Dec 30 2022 at 04:27:56 PM -0600, Ian Pilcher wrote: On 12/30/22 15:47, Paul Bryan wrote: What kind of elements are being added to the set? Can you show repr

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Paul Bryan
I would suggest allowing each module to define its own imports, don't import what a module doesn't consume, keep them simple, avoid devising a common namespace for each, and let tools like isort/black work out how to order/express them in source files. On Wed, 2023-01-18 at 10:43 -0800, Dan Kolis

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Paul Bryan
On Thu, 2023-01-19 at 09:47 +1300, dn via Python-list wrote: > The longer an identifier, the more it 'pushes' code over to the right > or  > to expand over multiple screen-lines. Some thoughts on this are > behind > PEP-008 philosophies, eg line-limit. I sympathize with this issue. I've pushed t

Re: Typing Number, PyCharm

2023-02-06 Thread Paul Bryan
On Mon, 2023-02-06 at 12:11 +, Weatherby,Gerard wrote: > On the one hand, it is a well-known type, so it should be > recognizable to users of an API. On the other hand, Number is > entirely abstract, so it doesn’t provide useful type checking for the > implementation; I had to add # noinspecti

Re: Line continuation and comments

2023-02-22 Thread Paul Bryan
Adding to this, there should be no reason now in recent versions of Python to ever use line continuation. Black goes so far as to state "backslashes are bad and should never be used": https://black.readthedocs.io/en/stable/the_black_code_style/future_style.html#using-backslashes-for-with-statement

c bindings with non-python thread callback while python exits

2021-01-26 Thread Paul Grinberg
hangs because the main thread is waiting for the event pthread to join, but that thread is stuck in a callback waiting for the GIL. What is the right way to prevent this problem from happening? Thank you in advance, Paul. P.S. I am running on Linux: ubuntu 18.04 with python 3.6.9, also reproduced

Re: Python cannot count apparently

2021-02-07 Thread Paul Bryan
That's not the only problem with the code. There's a missing close- paren and a reference to "string" which I presume was meant to be "myString". Suggest OP create a reproducible case, and paste the code and output verbatim. On Sun, 2021-02-07 at 20:40 +0100, Karsten Hilbert wrote: > Am Sun, Feb

Re: Mutable defaults

2021-02-10 Thread Paul Bryan
Also -1 on changing the existing default behavior. +1 to an opt-in late-bound solution. On Thu, 2021-02-11 at 10:29 +1100, Chris Angelico wrote: > On Thu, Feb 11, 2021 at 10:17 AM J. Pic wrote: > > > > > Most of us know of the perils of mutable default values. > > > > And those who don't pay th

Re: New Python implementation

2021-02-11 Thread Paul Bryan
uch a statement? > Thanks for the sentiment but I am not relying on luck. By your conduct so far, I think you will also not be relying on the goodwill of this community. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Fw: Scipy installation

2021-02-18 Thread Paul Bryan
Can you describe what you tried, and how it failed? Pasting error messages and such would be helpful. On Thu, 2021-02-18 at 17:53 +, Mustafa Althabit via Python-list wrote: >   > >    Hi,I am trying to install Scipy but it failed, I have python > 3.9. I need your assistance with that.  > Than

Re: program python

2021-03-04 Thread Paul Bryan
I don't see a Python program in that link. Are you asking how to extract data from a CSV? A good start will be to look into the csv.reader function and csv.DictReader class. Paul On Thu, 2021-03-04 at 12:36 -0800, alberto wrote: > Hi I'm tring to write a program with python to eva

Re: Apriori Algorithm

2021-03-06 Thread Paul Bryan
Google tells me this: https://github.com/tommyod/Efficient-Apriori On Sat, 2021-03-06 at 18:46 -0800, sarang shah wrote: > I want to make apriori algorithm from start. Anybody have any > reference file? -- https://mail.python.org/mailman/listinfo/python-list

Re: SSL certificate issue

2021-03-18 Thread Paul Bryan
In order for us to help, we'll need to know the details of your problem. On Thu, 2021-03-18 at 10:58 +, Sagar, Neha wrote: > Hi, > > I am facing SSL certificate issue working with python. Can you help > me on this. > > Thanks, > Neha > > DXC Technology India Private Limited - Unit 13, Block

Re: .title() - annoying mistake

2021-03-19 Thread Paul Bryan
es form word boundaries, which may not be the desired result The link above includes a workaround for apostrophes. Paul On Fri, 2021-03-19 at 18:43 +0400, Abdur-Rahmaan Janhangeer wrote: > Greetings list, > > See this: > > > > > "Python's usage".title() > &q

Re: .title() - annoying mistake

2021-03-21 Thread Paul Bryan
ing to be baked into the simplistic `str.title` method. As demonstrated by the OP, it will almost certainly come up short, even in the simplest use case. I suggest the best approach then is to find (or write) a module that addresses the specific use case, not try to address such shortcomings in `

port to PDOS (especially mainframe)

2021-03-23 Thread Paul Edwards
n PDOS/3X0. Well, maybe it can all be done on Windows. I need to see what asma is capable of. Thanks. Paul. # Produce Windows executables # links with PDPCLIB created by makefile.msv CC=gccwin CFLAGS=-O0 LD=ldwin LDFLAGS= AS=aswin AR=arwin STRIP=stripwin COPTS=-S $(CFLAGS) -fno-common -ansi -I. -

Re: port to PDOS (especially mainframe)

2021-03-23 Thread Paul Edwards
#x27;t see how other platforms are circumventing that problem. (ie I did a grep -R of the whole source code). I could define a stack of constants in pyconfig.h to allow the compile to go through, but I don't see anyone else doing the same thing. Is there some other way of circumventing the problem? Thanks. Paul. -- https://mail.python.org/mailman/listinfo/python-list

Re: port to PDOS (especially mainframe)

2021-03-23 Thread Paul Edwards
On Tuesday, March 23, 2021 at 10:19:46 PM UTC+11, Paul Edwards wrote: > My latest problem is this: > > Objects/exceptions.c: ADD_ERRNO(ConnectionRefusedError, ECONNREFUSED); Sorry, I forgot to include the actual error: ../Objects/exceptions.c:2538: `ECONNREFUSED' undeclared (fir

Re: port to PDOS (especially mainframe)

2021-03-23 Thread Paul Edwards
On Tuesday, March 23, 2021 at 10:19:46 PM UTC+11, Paul Edwards wrote: > Objects/exceptions.c: ADD_ERRNO(ConnectionRefusedError, ECONNREFUSED); > > Those errno are non-standard (non-C90) and I assume > other platforms can't cope with that either. But I can't > se

Re: port to PDOS (especially mainframe)

2021-03-23 Thread Paul Edwards
sockets? Does it have WinSock? Something > else? Nothing at all? (sorry for the delay in replying) Nothing at all. Just what you can find in ISO/IEC 9899:1990. BFN. Paul. -- https://mail.python.org/mailman/listinfo/python-list

Re: port to PDOS (especially mainframe)

2021-03-24 Thread Paul Edwards
hon requires C99 since 3.6, Exactly why I go back to the oldest version I can! BFN. Paul. -- https://mail.python.org/mailman/listinfo/python-list

Re: Code Formatter Questions

2021-03-28 Thread Paul Bryan
s there anyway to make any of these formatters do this? Formatters are typically strongly opinionated (autopep8 being an exception), so I think you'll be going against the grain by trying to make exceptions. I suggest accepting their opinions (pick the formatter that most closely aligns with y

<    1   2   3   4   5   6   7   8   9   10   >