Re: UTF_16 question

2024-04-29 Thread Richard Damon via Python-list
> On Apr 29, 2024, at 12:23 PM, jak via Python-list > wrote: > > Hi everyone, > one thing that I do not understand is happening to me: I have some text > files with different characteristics, among these there are that they > have an UTF_32_le coding, utf_32be, utf_16_le, utf_16_be all of them

Re: Python misbehavior

2024-02-08 Thread Richard Damon via Python-list
entation for youtube-dlp, you may find that you can use that module directly, and not need the ClipGrab wrapper at all (though it may provide some benefits if you can get it working again). -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: How/where to store calibration values - written by program A, read by program B

2023-12-28 Thread Richard Damon via Python-list
On 12/28/2023 12:20 AM EST rbowman via Python-list <[1]python-list@python.org> wrote: On Wed, 27 Dec 2023 03:53:42 -0600, Greg Walters wrote: The biggest caveat is that the shared variable MUST exist before it can be examined or used (not surprising).

Context without manager

2023-11-27 Thread Richard Damon via Python-list
Read the Fine context manager documentation. What “with with_expression as var” does is effectively: ob = with_expression var = ob.__enter__() And then at the end of the with, does a ob.__exit__() (With some parameters to __exit__, that could just be None, None, None for the simplest case).

Re: Context without manager

2023-11-27 Thread Richard Damon via Python-list
Read the Fine context manager documentation. What “with with_expression as var” does is effectively: ob = with_expression var = ob.__enter__() And then at the end of the with, does a ob.__exit__() (With some parameters to __exit__, that could just be None, None, None for the simplest case).

Re: type annotation vs working code

2023-10-01 Thread Richard Damon via Python-list
t to True when you initialize), and look it up with getattr() with a default value of False. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: GNU gettext: Print string translated and untranslated at the same time

2023-08-17 Thread Richard Damon via Python-list
> On Aug 17, 2023, at 10:02 AM, c.buhtz--- via Python-list > wrote: > > X-Post: https://stackoverflow.com/q/76913082/4865723 > > I want to display one string in its original source (untranslated) version > and in its translated version site by site without duplicating the string in > the

Re: Multiple inheritance and a broken super() chain

2023-07-03 Thread Richard Damon via Python-list
_init__()* is called twice. What's going on here? Thanks, Peter Because the MRO from Bottom is [Bottom, Left, Right, Top] so super() in Left is Right. It doesn't go to Top as the MRO knows that Right should go to Top, so Left needs to go to Right to init everything, and then Bottom messes things

Re: Problems Installing and getting started.

2023-05-31 Thread Richard Damon
How are you trying to “Open” python? If you get that option screen, that sounds like you are trying to run the installer again. Knowing your Operating System would be very helpful. Python is normally run from the command line, or since you have the PyCharm IDE, it can run python on the program

Re: Addition of a .= operator

2023-05-20 Thread Richard Damon
allow. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Weak Type Ability for Python

2023-04-13 Thread Richard Damon
and if so, converts its value to that type and does the operation. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: How does a method of a subclass become a method of the base class?

2023-03-26 Thread Richard Damon
ch would be to use the concept of an "abstract base" which allows the base to indicate that a derived class needs to define certain abstract methods, (If you need that sort of support, not defining a method might just mean the subclass doesn't support some optional behavior defined b

Re: Precision Tail-off?

2023-02-17 Thread Richard Damon
of the IEEE. I would like to know their response to it. That is why they have developed the Decimal Floating point format, to handle people with those sorts of problems. They just aren't common enough for many things to have adopted the use of it. Stephen Tucker. -- Richard Damon -- https

Re: evaluation question

2023-02-01 Thread Richard Damon
ode Points, and you can define string literals of that type with U"string" notation. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: evaluation question

2023-02-01 Thread Richard Damon
es if the data is all Latin-1, as a sequence of 16-bit words if the data all fits on th BMP, and a sequence of 32 bit words if it has a value outside the BMP. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: To clarify how Python handles two equal objects

2023-01-11 Thread Richard Damon
hat you still might be just a bit off. -- "Peace cannot be kept by force. It can only be achieved through understanding." -- Albert Einstein -- https://mail.python.org/mailman/listinfo/python-list -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: No solution for "--verbose" (on stdout) output in Pythonds standard library?

2023-01-04 Thread Richard Damon
> On Jan 4, 2023, at 8:56 AM, c.bu...@posteo.jp wrote: > > Hello, > > first I have to say that in my current and fresh humble opinion the > often seen "--verbose" switch in command line applications should > affect only the messages given to the users. This means messages on > "stdout". That

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread Richard Damon
 > On Jan 3, 2023, at 10:38 AM, c.bu...@posteo.jp wrote: > Hello, > > this posting isn't about asking for a technical solution. My intention > is to understand the design decision Python's core developers made in > context of that topic. > > The logging module write everything to stderr no

Re: Nonuniform PRNG?

2022-12-07 Thread Richard Damon
, but the new test criteria would need to be computed based on computing the exected results and expected variation in that result, largely based on various cross correlations of the numbers. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: How to make a variable's late binding crosses the module boundary?

2022-08-28 Thread Richard Damon
rrent x.y object. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Trying to understand nested loops

2022-08-06 Thread Richard Damon
On 8/6/22 8:12 AM, Chris Angelico wrote: On Sat, 6 Aug 2022 at 22:08, Richard Damon wrote: On 8/6/22 12:01 AM, Chris Angelico wrote: On Sat, 6 Aug 2022 at 13:54, Dan Stromberg wrote: On Fri, Aug 5, 2022 at 12:54 PM Grant Edwards wrote: In C, this doesn't do what it looks like it's

Re: Trying to understand nested loops

2022-08-06 Thread Richard Damon
enabled that you don't care about, or your code is doing things you have told the complier you shouldn't do. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Subtract n months from datetime

2022-06-21 Thread Richard Damon
s that often a month later than a given day isn't the same day of the month, but does make some operations less surprising. (This is hard to do to a date expressed as year-month-day, but trivial in some other formats like a timestamp.) -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Automatic Gain Control in Python?

2022-05-29 Thread Richard Damon
understanding how to grab podcasts. The system is working very well for that. Footnote: “What rhymes with orange?” “No, it doesn’t..” -Original Message- From: Richard Damon On Behalf Of Richard Damon Sent: Saturday, May 28, 2022 11:37 PM To: Steve GS Subject: Re: Automatic Gain Control in

Re: Automatic Gain Control in Python?

2022-05-28 Thread Richard Damon
t the material is surely under Copyright, so be careful what you do with it. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: struggle to upgrade pip on visual studio code

2022-04-22 Thread Richard Damon
ld be able to simpify that to python -m pip install --upgrade -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: No shortcut Icon on Desktop

2022-04-14 Thread Richard Damon
rt of program that makes sense to make a desktop icon for, as it is a command line utility. Perhaps making an icon for IDLE, if it has also been installed, but then the issue becomes would people recognize 'IDLE' as 'Python' to click on. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: C is it always faster than nump?

2022-02-25 Thread Richard Damon
On 2/25/22 2:47 PM, Chris Angelico wrote: On Sat, 26 Feb 2022 at 05:49, Richard Damon wrote: On 2/25/22 4:12 AM, BELAHCENE Abdelkader wrote: Hi, a lot of people think that C (or C++) is faster than python, yes I agree, but I think that's not the case with numpy, I believe numpy is faster than

Re: C is it always faster than nump?

2022-02-25 Thread Richard Damon
without that level of care and effort. There are similar package available for many languages, including C/C++ to let mere mortals get efficient numerical processing. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: frozenset can be altered by |=

2021-11-29 Thread Richard Damon
doesn't support the inplace operator, it is automatically converted into the equivalent assignment with the binary operator? -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: pyinstaller wrong classified as Windows virus

2021-11-25 Thread Richard Damon
source may still be against the rules (and needs approval), but some think if they can do it and no one complains, it must be ok. On the other hand, they may have given approval, knowing the source. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: on writing a while loop for rolling two dice

2021-09-07 Thread Richard Damon
the order you do things, the cases where the difference is intended is likely fairly small. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: on floating-point numbers

2021-09-05 Thread Richard Damon
> On Sep 5, 2021, at 6:22 PM, Peter J. Holzer wrote: > > On 2021-09-04 10:01:23 -0400, Richard Damon wrote: >>> On 9/4/21 9:40 AM, Hope Rouselle wrote: >>> Hm, I think I see what you're saying. You're saying multiplication and >>> division in IE

Re: on floating-point numbers

2021-09-04 Thread Richard Damon
On 9/4/21 9:40 AM, Hope Rouselle wrote: > Chris Angelico writes: > >> On Fri, Sep 3, 2021 at 4:58 AM Hope Rouselle wrote: >>> >>> Hope Rouselle writes: >>> Just sharing a case of floating-point numbers. Nothing needed to be solved or to be figured out. Just bringing up

Re: configargparse - reading option from config only

2021-08-27 Thread Richard Damon
On 8/27/21 3:37 AM, Loris Bennett wrote: > Richard Damon writes: > >> On 8/26/21 6:01 AM, Loris Bennett wrote: >>> Hi, >>> >>> When using configargparse, it seems that if a value is to be read from a >>> config file, it also has to be defined as

Re: configargparse - reading option from config only

2021-08-26 Thread Richard Damon
> > Is there an elegant way to do this? > > Cheers, > > Loris > Look at the read() member function to supply the file name to read. Then in the config object there will be sections for each section in the config file. No need for any of these to be 'options' -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: what to do with multiple BOMs

2021-08-19 Thread Richard Damon
By the rules of Unicode, that character, if not the very first character of the file, should be treated as a “zero-width non-breaking space”, it is NOT a BOM character there. It’s presence in the files is almost certainly an error, and being caused by broken software or software processing

Re: optimization of rule-based model on discrete variables

2021-06-14 Thread Richard Damon
e rule set covers every value in the data array, and never gives one input value two different y values. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python ...

2021-05-25 Thread Richard Damon
tate the object the parameter was bound to, the calling function will see the changed object. (This requires the object to BE mutateable, like a list, not an int) If you rebind that parameter to a new object, the calling function doesn't see the change, as its name wasn't rebound. -- Richard D

Re: Unexpected Inheritance Problem

2021-05-20 Thread Richard Damon
On 5/20/21 1:58 AM, Chris Angelico wrote: > On Thu, May 20, 2021 at 2:02 PM Richard Damon > wrote: >> Given the following definition of classes, I am getting an unexpected >> error of : >> >> TypeError: __init__() missing 2 required keyword-only a

Re: Unexpected Inheritance Problem

2021-05-20 Thread Richard Damon
On 5/20/21 3:24 AM, Peter Otten wrote: > On 20/05/2021 06:00, Richard Damon wrote: > >> class GedcomHead(Gedcom0Tag): >> """GEDCOM 0 HEAD tag""" >> def ___init___(self, *, parent): > > An __init__ with three underscores; you m

Unexpected Inheritance Problem

2021-05-19 Thread Richard Damon
too, even though there is a call to it through the super().__init__() Is this expected? Can derived classes not provide values for parameters to construct the base classes? Is there something funny because I am making the call from a member of that base class? -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: for the installation of pycharm

2021-05-08 Thread Richard Damon
On 5/8/21 10:49 AM, mishrasamir2...@gmail.com wrote: >Sir/madam, > >Please provide me the latest version of pycharm quickly. > >Samir Mishra You just need to go to the jetbrains web site and it is available there. They even have a free version there. -- Richard D

Re: Proposal: Disconnect comp.lang.python from python-list

2021-05-06 Thread Richard Damon
On 5/6/21 9:44 AM, Jon Ribbens via Python-list wrote: > On 2021-05-06, Richard Damon wrote: >> On 5/6/21 6:12 AM, Jon Ribbens via Python-list wrote: >>> I think you're fundamentally missing the point that the newsgroup is >>> *already gatewayed to the mailing list*.

Re: Proposal: Disconnect comp.lang.python from python-list

2021-05-06 Thread Richard Damon
ing a distributed system, doesn't support this model. Either anybody can inject a message from wherever they are, no all messages are sent to be reviewed, the unmoderated and moderated is a VERY sharp line. In Usenet terms, lists like this would be described as loosely robo-moderated. And it works a lot bette

Re: Proposal: Disconnect comp.lang.python from python-list

2021-05-06 Thread Richard Damon
On 5/6/21 6:12 AM, Jon Ribbens via Python-list wrote: > On 2021-05-06, Richard Damon wrote: >> On 5/5/21 10:44 PM, Jon Ribbens via Python-list wrote: >>> On 2021-05-06, Richard Damon wrote: >>>> As someone with a long usenet background, converting the existing

Re: Proposal: Disconnect comp.lang.python from python-list

2021-05-05 Thread Richard Damon
On 5/5/21 10:44 PM, Jon Ribbens via Python-list wrote: > On 2021-05-06, Richard Damon wrote: >> On 5/5/21 9:40 PM, Jon Ribbens via Python-list wrote: >>> On 2021-05-06, Paul Bryan wrote: >>>> What's involved in moderating c.l.p? Would there be volunteers willing >

Re: Proposal: Disconnect comp.lang.python from python-list

2021-05-05 Thread Richard Damon
o it, and people would need to log into the email account on that computer to approve all the posts, or a robot could perhaps be setup to auto-approve most based on some rules. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: A 35mm film camera represented in Python object

2021-04-01 Thread Richard Damon
On 4/1/21 6:41 PM, 2qdxy4rzwzuui...@potatochowder.com wrote: > On 2021-04-01 at 18:10:46 -0400, > Richard Damon wrote: > >> On 4/1/21 5:47 PM, D.M. Procida wrote: >>> D.M. Procida wrote: >>> >>>> Hi everyone, I've created <https://github.com/

Re: A 35mm film camera represented in Python object

2021-04-01 Thread Richard Damon
determines that of B which > determines that of C which determines that of D which finally also > affects the movement of A. > > Any thoughts or wise ideas? > > Daniele If you keep track of the positions as a floating point number, the precision will be more than you could actually measure it. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: .title() - annoying mistake

2021-03-22 Thread Richard Damon
ay it is written, "Python's".istitle() is False, as the s at the end needs to be uppper case to satisfy as ' is uncased, so the next cased character must be upper case. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: .title() - annoying mistake

2021-03-21 Thread Richard Damon
On 3/21/21 10:28 PM, Chris Angelico wrote: > On Mon, Mar 22, 2021 at 12:26 PM Richard Damon > wrote: >> On 3/21/21 7:31 PM, MRAB wrote: >>> On 2021-03-21 22:30, Chris Angelico wrote: >>>> On Mon, Mar 22, 2021 at 9:04 AM Grant Edwards >>>> wrot

Re: .title() - annoying mistake

2021-03-21 Thread Richard Damon
; > title(self, /) >     Return a version of the string where each word is titlecased. > >     More specifically, words start with uppercased characters and all > remaining >     cased characters have lower case. > > '\N{LATIN CAPITAL LETTER DZ}', '\N{LATIN SMALL LETTER DZ}' and > '\N{LATIN CAPITAL LETTER D WITH SMALL LETTER Z}' are all digraphs, so > is it correct to say that .title() uppercases the first character? > Kind of. I think the clarification calling them upper cased characters is close enough considering that there are only 31 title cased characters, all digraphs. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: .title() - annoying mistake

2021-03-21 Thread Richard Damon
One important thing to remember is that there ARE a few characters that are themselves 'Title case', so we can't live with just upper and lower. These all are 'digraphs', i.e. look like two letters, but this glyph does act as a single character for many purposes. One example that has been given i

Re: .title() - annoying mistake

2021-03-21 Thread Richard Damon
itle() function is basically an intentionally 80% solution. It handles the simple cases simply, and if you might have the more complicated cases, you have to handle that yourself because to specify what the 'right' answer would be is basically impossible to do in general (because there are conflicting d

Re: Why assert is not a function?

2021-03-13 Thread Richard Damon
On 3/12/21 8:58 AM, Chris Angelico wrote: > On Sat, Mar 13, 2021 at 12:11 AM Richard Damon > wrote: >> On 3/12/21 12:31 AM, Chris Angelico wrote: >>> On Fri, Mar 12, 2021 at 3:53 PM Cameron Simpson wrote: >>>> For me, try/except is for when something might rea

Re: Why assert is not a function?

2021-03-12 Thread Richard Damon
r'. It is reasonable to skip the input assert if it becomes too expensive for benefit it provides, or if something else will catch the error. This likely actually applies to a lot of Python code, so it may seem that it doesn't apply. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Button placement

2021-03-09 Thread Richard Damon
earing when fighting with it with padding lol. > > -- > Thanks One thing to remember is that span is sort of like range, range(3) is [0, 1, 2] -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: How to implement logging for an imported module?

2021-03-08 Thread Richard Damon
a different value. General convention is that modules will use their name as the name of their logger, as that is generally unique. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Tkinter long-running window freezes

2021-02-25 Thread Richard Damon
ing it each time.  Simplest is probably to link the Label to a StringVar instead of a fixed text and updating the variable to change the text. You can also (I believe) go into the Label and change the text it has with a configuration call. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 2.7 and 3.9

2021-02-16 Thread Richard Damon
n how everything was installed and how the path was setup. You will at least need the version 2 and version 3 pythons to be given different names, like python3 and then start the python 3 scripts with python3 my_script.py -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python building 2nd app, need advices

2021-01-08 Thread Richard Damon
On 1/8/21 6:10 PM, pascal z via Python-list wrote: > any way to attach a file because I loose indentation? Don't post via googlegroups, it thinks the world is HTML, which treats spaces in a funny matter. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: tkinter: creating/attaching menubar to top level window

2021-01-08 Thread Richard Damon
ar # attach it to the top level window > ^ > yet that's the syntax he prints on page 84 (and has in the book's code > supplement). > > Why am I getting an invalid syntax error here? > > TIA, > > Rich Because it is the wrong syntax. It could be either: self.men

Re: dayofyear is not great when going into a new year

2021-01-05 Thread Richard Damon
irst day of the ISO week bsed 2020, and he ended it with a comment that if 2019 wasn't going so well, you could always just use ISO to get an early start on 2020. Apparently a lot of people were getting this recommended a number of months later, and people were commenting how that line just was not aging well. And we couldn't use that te get out of 2020, as 2020 is a long year, and ISO 2021 didn't start until Jan 4th. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: A random word from one of two lists

2021-01-03 Thread Richard Damon
: > > import random > animal = ['koala', 'kangaroo'] > fruit = ['banana', 'apple'] > result = random.choice(animal + fruit) > print(result) It depends on what distribution of results you want. Since the example had two equal length list is doesn't matter, but if, say, t

Re: A random word from one of two lists

2021-01-01 Thread Richard Damon
object. Which is the same object that one of the variables that you used. IF you wanted to use words, then you could have made kinds = {'animals', 'fruits'} and then looked up the list in words, but that is really just more work (unless you want to know which list it came from) Note t

Re: Which method to check if string index is queal to character.

2020-12-28 Thread Richard Damon
probably beyond what a regex could handle. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Which method to check if string index is queal to character.

2020-12-28 Thread Richard Damon
in comments or display names, but just a base email address isn't that hard). Many people do still get it wrong. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Which method to check if string index is queal to character.

2020-12-28 Thread Richard Damon
email address isn't THAT hard, but there are a number of edge cases to worry about. Validating that it is a working email address (presumably after verifying that it has a proper syntax) is much harder, and basically requires trying to send to the address, and to really confirm that it is good requires t

Re: tkinter global variable

2020-11-13 Thread Richard Damon
On 11/13/20 12:12 PM, ChalaoAdda wrote: > On Fri, 13 Nov 2020 12:04:53 -0500, Richard Damon wrote: > >> On 11/13/20 11:42 AM, ChalaoAdda wrote: >>> On Fri, 13 Nov 2020 16:04:03 +, Stefan Ram wrote: >>> >>>> ChalaoAdda writes: >>>>

Re: tkinter global variable

2020-11-13 Thread Richard Damon
got the point. So what do I need to do access the variable? How do > I return a value from that function? > > Thanks. The problem is that you are accessing the variable BEFORE the box has been put up and the user clicking on it. That doesn't happen until the mainloop() call. You need to delay the opening and reading of the file till the filedialog has been used and returned. Perhaps on_openfile could open and read the file. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there a conflict of libraries here?

2020-11-08 Thread Richard Damon
me, and avoid the name conflict. It just says that in your code, to use the class you either need to use Datatime or datetime.datetime -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: What might cause my sample program to forget that already imported datetime?

2020-10-12 Thread Richard Damon
for: import MODULE from MODULE import * as if you are bringing in ALL the names into the current module name space, when will you need to use the module.symbol notation? -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Help! I broke python 3.9 installation on macOS

2020-10-08 Thread Richard Damon
On 10/8/20 7:31 PM, Elliott Roper wrote: > First problem: I can no longer say > Obfuscated@MyMac ~ % python3 pip -m list isn't that supposed to be python3 -m pip list -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Use of a variable in parent loop

2020-09-27 Thread Richard Damon
sses have a scope, control structures do not. If control structures created a scope it would be ugly. You do need to watch out about the difference between classical 'variables' and pythons name binding when you deal with mutable objects; For example: a = [] b = a a.append(1) print(b) give [1] as a and b are bound to the same object, even though you want to think of them as different variables. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Puzzling difference between lists and tuples

2020-09-17 Thread Richard Damon
eeded to make them) ('first') is just the string value 'first', inside a set of parenthesis to possible affect order of operations. For 1 element tuples, you need a trailing comma, like ('first,) and in many places it also could be just 'first', just like your first example could be just for n in 'first', 'second': -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Your confirmation is required to join the Python-list mailing list

2020-09-10 Thread Richard Damon
Lian > Sounds like you keep re-running the installer rather than the installed version of python. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Fwd: PYTHON BUG. deleting elements of list.

2020-09-08 Thread Richard Damon
th your code, when he gets half way done he will hit an index error as he tries to delete _list[26] from a list with only 25 elements. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Symlinks already present

2020-09-01 Thread Richard Damon
On 9/1/20 9:03 AM, Chris Angelico wrote: > On Tue, Sep 1, 2020 at 10:57 PM Richard Damon > wrote: >> On 8/31/20 6:05 PM, Chris Angelico wrote: >>> On Tue, Sep 1, 2020 at 5:08 AM Richard Damon >>> wrote: >>>> The file descriptor could remember the

Re: Symlinks already present

2020-09-01 Thread Richard Damon
On 8/31/20 6:05 PM, Chris Angelico wrote: > On Tue, Sep 1, 2020 at 5:08 AM Richard Damon wrote: >> The file descriptor could remember the path used to get to it. chroot >> shows that .. needs to be somewhat special, as it needs to go away for >> anyone that . is their current

Re: Symlinks already present

2020-08-31 Thread Richard Damon
On 8/31/20 12:49 PM, Chris Angelico wrote: > On Tue, Sep 1, 2020 at 2:40 AM Richard Damon wrote: >> On 8/31/20 9:00 AM, Chris Angelico wrote: >>> That's incompatible with the normal meaning of "..", and it also >>> implies that any time you rename any direc

Re: Symlinks already present

2020-08-31 Thread Richard Damon
; Barry > This is based on a hypothetical OS that allows creating hard-links to directories, just like to files. Because current *nix system don't do it this way, they don't allow hard-links to directories because it does cause this sort of issue. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Symlinks already present

2020-08-31 Thread Richard Damon
On 8/31/20 9:00 AM, Chris Angelico wrote: > On Mon, Aug 31, 2020 at 9:57 PM Richard Damon > wrote: >> On 8/31/20 3:35 AM, Chris Angelico wrote: >>> On Mon, Aug 31, 2020 at 5:28 PM Cameron Simpson wrote: >>>>> Because of the ".." issue, it's not

Re: Symlinks already present

2020-08-31 Thread Richard Damon
the reference of implicit via the current working directory. That can define what is the parent. Yes, that says that two references to the 'same' directory (same as in same inode, but different paths) will find a different value for .. in it. So the definition of .. can be well defined, even in the presence of multiple parent directories. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Aw: Re: Python 3 how to convert a list of bytes objects to a list of strings?

2020-08-29 Thread Richard Damon
h mailbox format is being used. There may be a few other small details that needs to happen to. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3 how to convert a list of bytes objects to a list of strings?

2020-08-29 Thread Richard Damon
it is going to have bytes >128 > unless it's encoded some way to make it 7-bit and that's not going to > happen in the general case. > When I took a quick look at the mailbox class, it said it could take a 'string', or a 'message'. It may well be that the string option assumes ASCII. You may need to use the message parsing options of message to convert messages with extended characters into the right format. This is one of the cases where Python 2's non-strictness made things easier, but also much easier to get wrong if not careful. Python 3 is basically making you do more work to make sure you are doing it right. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3 how to convert a list of bytes objects to a list of strings?

2020-08-28 Thread Richard Damon
(even if > mis-formatted or mis-encoded) into the mbox. > It looks like the mailbox class has gotten 'pickier' in Python 3, and won't accept a message as a byte string, just as either a email message or a real string. My guess would be that 'simplest' path would be to convert your message into a parsed Message class, and add that. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3 how to convert a list of bytes objects to a list of strings?

2020-08-28 Thread Richard Damon
On 8/28/20 8:39 AM, Chris Green wrote: > Richard Damon wrote: >> On 8/28/20 7:50 AM, Karsten Hilbert wrote: >>>>> No interpreation requires, since parsing failed. Then you can start >>>>> dealing with these exceptions. _Do not_ write unparsable messages

Re: Aw: Re: Python 3 how to convert a list of bytes objects to a list of strings?

2020-08-28 Thread Richard Damon
ll the text 'properly', and would be helpful if some of the patterns being checked for contained 'extended' (non-ASCII) characters. One possible solution in Python3 is to decode the byte string using an encoding that allows all 256 byte values, so it won't raise any encoding errors, just give your p

Re: Aw: Re: Python 3 how to convert a list of bytes objects to a list of strings?

2020-08-28 Thread Richard Damon
Are we saying that Python 3 really can't be made to handle things >> 'tolerantly' like Python 2 used to? > It sure should be possible but it will require *explicit* en/decode()s in > more places than before because AFAICT there's less impliciteness as to > which encoding to apply (r

Re: Another 2 to 3 mail encoding problem

2020-08-27 Thread Richard Damon
thon 3 str type is not suitable to store an email message, since it insists on the string being Unicode encoded, but the Python 2 str class could hold it. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Why __hash__() does not return an UUID4?

2020-08-26 Thread Richard Damon
sh(y) were random numbers, then how would this property be maintained? > > Or do UUID4 mean something else to you than a random number? Looking up which UUID type 4 is, yes it is a random number, so could only be applicable for objects that currently return id(), which could instead make id

Re: Why __hash__() does not return an UUID4?

2020-08-26 Thread Richard Damon
the typical use of hash will be followed by a real equality test if the hashes match, we don't need the level of a UUID -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: About float/double type number in range.

2020-08-26 Thread Richard Damon
expected value) or slightly lower (where you would get the top 'excluded' value listed). This sort of unpredictability is part of the difficulty dealing with floating point. As was pointed out, you can scale the range, or build your own generator to get what you want. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Final statement from Steering Council on politically-charged commit messages

2020-08-18 Thread Richard Damon
igher power, it has no authority, except might, to enforce it. If we accept might as the right and power to rule, we need to accept that it was and will be the right and power, and accept what it brought and will bring. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Final statement from Steering Council on politically-charged commit messages

2020-08-18 Thread Richard Damon
e even needing to wait for your 'master' to ask before you went to the bathroom, or be considered to be 'malfunctioning'. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?

2020-08-15 Thread Richard Damon
A few comments come to mind about this discussion about TCO. First, TCO, Tail Call Optimization, is talking about something that is an optimization. Optimizations, are generally some OPTIONAL improvement in the method of executing the code that doesn't alter its DEFINED meaning. First big

Re: Including a Variable In the HTML Tags When Sending An Email

2020-08-09 Thread Richard Damon
On 8/9/20 6:22 PM, sammy.jackson...@gmail.com wrote: > On Sunday, August 9, 2020 at 1:32:30 AM UTC+1, Richard Damon wrote: >> On 8/8/20 8:03 PM, sammy.jackson...@gmail.com wrote: >>> If i use place holders i.e. {0} and {1} where {0} is the name and {1} is >>> t

Re: Including a Variable In the HTML Tags When Sending An Email

2020-08-08 Thread Richard Damon
to get them into clean html. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Including a Variable In the HTML Tags When Sending An Email

2020-08-08 Thread Richard Damon
ld i include this variable in my HTML/Python code? > > Any ideas? > > Thank you. Since you are already using .format to insert the message body, you might as well do something similar to insert the name, adding more placeholders for the format to insert into. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   >