Unable to install or operate PIP on Windows 10

2020-03-29 Thread Steven Hobbs
Can I please have step by step instructions that have been verified to work with Windows 10 and Python 3.7.7 that list all requirements, dependencies and processes to install and run pip and then install libraries such as numpy and pillow. Any help would be greatly appreciated. Regards, Steven

Modify setup

2019-07-30 Thread Steven via Python-list
Good morning, I have uninstalled and reinstalled different versions of Python, and continue to get the "modify setup" box when I try to open. Is there something I'm doing wrong? Sent from ProtonMail mobile -- https://mail.python.org/mailman/listinfo/python-list

Trouble installing python

2019-07-28 Thread Steven via Python-list
nline instructor is using) now i keep getting a screen asking me to modify, repair, or uninstall (screen shoot attached). I have clicked repair twice now, and modify once and I still get the same message. Am I doing something wrong in 3.7 that is maybe hiding script mode? Thank you Steven Sent

So apparently I've been banned from this list

2018-09-30 Thread Steven D'Aprano
ime, I may not reply on-list to any responses. Subject: Fwd: Temporary Suspension To: From: Ethan Furman Date: Tue, 11 Sep 2018 11:22:40 -0700 In-Reply-To: Steven, you've probably already seen this on Python List, but I forgot to email it directly to you. My apologies. -- ~Ethan~ Python Lis

Trying to use threading.local()

2018-09-12 Thread Steven D'Aprano
_bootstrap_inner self.run() File "/usr/local/lib/python3.5/threading.py", line 862, in run self._target(*self._args, **self._kwargs) File "", line 5, in worker AttributeError: '_thread._local' object has no attribute 'value' What am I doing w

Re: Any SML coders able to translate this to Python?

2018-09-07 Thread Steven D'Aprano
On Fri, 07 Sep 2018 15:10:10 +0100, Paul Moore wrote: > On Fri, 7 Sep 2018 at 14:06, Steven D'Aprano > wrote: [...] >> However I have a follow up question. Why the "let" construct in the >> first place? Is this just a matter of principle, "put everyth

Re: don't quite understand mailing list

2018-09-07 Thread Steven D'Aprano
s not ridicule.) -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Object-oriented philosophy

2018-09-07 Thread Steven D'Aprano
e on the day. That will often be the "get" method. But on the rare occasions I do care about performance, the basic rule of thumb I use is that if the key is likely to be missing more than about 10% of the time, I use the "LBYL" idiom (either an explicit test using "if key

Re: Any SML coders able to translate this to Python?

2018-09-07 Thread Steven D'Aprano
On Thu, 06 Sep 2018 13:48:54 +0300, Marko Rauhamaa wrote: > Chris Angelico : >> The request was to translate this into Python, not to slavishly imitate >> every possible semantic difference even if it won't actually affect >> behaviour. > > I trust Steven to b

Re: Object-oriented philosophy

2018-09-06 Thread Steven D'Aprano
;t use a "bare" except, i.e. one that doesn't > specify what exception(s) it should catch. Excellent advice! More here: https://realpython.com/the-most-diabolical-python-antipattern/ -- Steven D'Aprano "Ever since I learned about confirmation bias, I've

Re: don't quite understand mailing list

2018-09-06 Thread Steven D'Aprano
27;m speaking up now because your reply to Reto is unwelcoming, unhelpful and disrespectful, and coming from a moderator who has been known to ban people, that makes it even more hostile. [1] Yes, there are such things as stupid questions. If your doctor asked you "remind me again, whic

Re: Why emumerated list is empty on 2nd round of print?

2018-09-06 Thread Steven D'Aprano
n you need it, not to hold on to the reference for later. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Any SML coders able to translate this to Python?

2018-09-05 Thread Steven D'Aprano
*r+1 but I don't understand the let ... in part so I'm not sure if I'm doing it right. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Any SML coders able to translate this to Python?

2018-09-04 Thread Steven D'Aprano
rn 2*r+1 but I don't understand the let ... in part so I'm not sure if I'm doing it right. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about floating point

2018-09-01 Thread Steven D'Aprano
;>> >>>> > The first two format methods behave as expected. The old-style '%' > operator does not. The % operator casts the argument to a (binary) float. The other two don't need to, because they call Decimal's own format method. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about floating point

2018-08-31 Thread Steven D'Aprano
On Fri, 31 Aug 2018 18:45:16 +1200, Gregory Ewing wrote: > Steven D'Aprano wrote: >> The right way is to >> set the rounding mode at the start of your application, and then let >> the Decimal type round each calculation that needs rounding. > > It's not

Re: __init__ patterns

2018-08-30 Thread Steven D'Aprano
to make this a hard rule? Did anyone mention what the standard library does? Check out the dbm, logging, html, http, collections, importlib, and curses packages (and probably others): https://github.com/python/cpython/tree/3.7/Lib -- Steven D'Aprano "Ever since I learned

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-08-30 Thread Steven D'Aprano
calls your scripts. There are many choices: tkinter is provided in the Python standard library, but some people prefer wxPython, PyQT4, or other GUI toolkits. https://duckduckgo.com/?q=python+gui+toolkits -- Steven D'Aprano "Ever since I learned about confirmation bias, I'

Re: Question about floating point

2018-08-30 Thread Steven D'Aprano
On Thu, 30 Aug 2018 19:22:29 +1200, Gregory Ewing wrote: > Steven D'Aprano wrote: >> Why in the name of all that's holy would anyone want to manually round >> each and every intermediate calculation when they could use the Decimal >> module and have it do it a

Re: Question about floating point

2018-08-29 Thread Steven D'Aprano
nction: Or better still, DON'T manually use the round function, let the interpreter do the rounding for you by using Decimal. That's what its for. Why in the name of all that's holy would anyone want to manually round each and every intermediate calculation when they could use the

Re: Question about floating point

2018-08-29 Thread Steven D'Aprano
if you want a guard digit), a rounding mode (Banker's Rounding is recommended for financial applications), and just do your calculations with no "clever tricks". Add two numbers, then add tax: money = (a+b)*(1+t/100) compared to the "clever trick": money =

Re: Generating a specific list of intsgers

2018-08-24 Thread Steven D'Aprano
tarted? (I am an amateur) That's more a maths question than a programming question. Find out how to tackle it mathematically, and then we can code it. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Pylint false positives

2018-08-21 Thread Steven D'Aprano
oids closures altogether but we don't know the full requirements here and its hard to judge from the outside on why Marko picked the design he has and whether its a good idea. It could be a case of "ooh, closures are a shiny new hammer, this problem must be a nail!" but let's give him the benefit of the doubt and assume he has good reasons, not just reasons. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Partitioning a list

2018-08-21 Thread Steven D'Aprano
library/itertools.html -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Pylint false positives

2018-08-21 Thread Steven D'Aprano
asses and instances come with inheritance, self etc which is great if you want a class, but if you just want a simple module-like namespace without the extra file, classes are a pretty poor alternative. But they're all we've got. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Pylint false positives

2018-08-20 Thread Steven D'Aprano
On Mon, 20 Aug 2018 22:55:26 +0300, Marko Rauhamaa wrote: > Dan Sommers : > >> On Mon, 20 Aug 2018 14:39:38 +, Steven D'Aprano wrote: >>> I have often wished Python had proper namespaces, so I didn't have to >>> abuse classes as containers in this wa

Re: Idle

2018-08-20 Thread Steven D'Aprano
On Mon, 20 Aug 2018 14:46:32 +0400, NAB NAJEEB wrote: > Hi am a beginner can u tell me where can I write my codes I already > tried pycharm and atom.. both are not worked successfully always shows > error...pls guide me... What errors do they show? -- Steven D'Aprano "E

Re: Pylint false positives

2018-08-20 Thread Steven D'Aprano
ers in this way :-( (Not that I do this using "inner classes", but I do often want to use a class as a container for functions, without caring about "self" or wrapping everything in staticmethod.) -- Steven D'Aprano "Ever since I learned about confirmation bias,

Re: Pylint false positives

2018-08-20 Thread Steven D'Aprano
> statement, which is clearly worse than executing a def statement (0.1 > µs) or integer addition (0.05 µs). However, 7 microseconds is the least > of my programming concerns. And fair enough... premature optimization and all that. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Writing bytes to stdout reverses the bytes

2018-08-19 Thread Steven D'Aprano
On Mon, 20 Aug 2018 00:31:35 +, Steven D'Aprano wrote: > When I write bytes to stdout, why are they reversed? Answer: they aren't, use hexdump -C. Thanks to all replies! -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing i

Re: How to multiply dictionary values with other values based on the dictionary's key?

2018-08-19 Thread Steven D'Aprano
9, 'FEq_(0,_0,_3,_0)': } If you run print(varsdict) what does it show? (I have limited time to respond at the moment, so apologies for the brief answers. Hopefully someone else will step in with some help too.) -- Steven D'Aprano "Ever since I learned about

Writing bytes to stdout reverses the bytes

2018-08-19 Thread Steven D'Aprano
| hexdump 000 84fd 0804 000a 005 -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: How to multiply dictionary values with other values based on the dictionary's key?

2018-08-19 Thread Steven D'Aprano
On Sun, 19 Aug 2018 03:35:24 -0700, giannis.dafnomilis wrote: > On Sunday, August 19, 2018 at 3:53:39 AM UTC+2, Steven D'Aprano wrote: [...] >> If you know absolutely for sure that the key format is ALWAYS going to >> be 'FEq_()' then you can extract the fiel

Re: How to multiply dictionary values with other values based on the dictionary's key?

2018-08-19 Thread Steven D'Aprano
Feq_(i,_j,_k,_l)'] = temp If you want to leave the original in place and do something else with the result: result = varsdict['Feq_(i,_j,_k,_l)'] * A[i,j,k,l] print(result) -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it

Re: Pylint false positives

2018-08-19 Thread Steven D'Aprano
On Sun, 19 Aug 2018 11:43:44 +0300, Marko Rauhamaa wrote: > Steven D'Aprano : > >> On Sun, 19 Aug 2018 00:11:30 +0300, Marko Rauhamaa wrote: >> >>> In Python programming, I mostly run into closures through inner >>> classes (as in Java). >> >>

Re: How to multiply dictionary values with other values based on the dictionary's key?

2018-08-18 Thread Steven D'Aprano
h, the penny drops* ... Are you trying to generate the keys by using nested loops? for i in range(1000): # up to some maximum value for j in range(1000): for k in range(1000): for l in range(1000): key = "FEq_({0},_{1},_{2},_{3})".format(i,j,k,l)

Re: Pylint false positives

2018-08-18 Thread Steven D'Aprano
In practice I wouldn't even consider this for three methods. Six or eight seems like a reasonable cut-of point for me, but it depends on the specifics of the code and who I was writing it for. (Note that this makes me much more conservative than the usual advice given by system admins, when

Re: Pylint false positives

2018-08-18 Thread Steven D'Aprano
that means no decorators, no closures, no introspection ("reflection" in Java terms), no metaclasses (other than type), no use of descriptors (other than the built-in ones), no template- based programming, no source-code generators. No namedtuples, Enums, or data-classes. -- Stev

Re: Pylint false positives

2018-08-17 Thread Steven D'Aprano
tates the intention "These methods are identical except in their name" more strongly than creating them in a loop? -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Pylint false positives

2018-08-17 Thread Steven D'Aprano
On Fri, 17 Aug 2018 11:49:01 +, Jon Ribbens wrote: > On 2018-08-17, Steven D'Aprano > wrote: >> On the other hand, your objection to the following three idioms is as >> good an example of the Blurb Paradox as I've ever seen. > > Do you mean the Blub Parad

Re: Pylint false positives

2018-08-16 Thread Steven D'Aprano
using a separate method per subclass does exactly what I > want, and that part of my project has been working stably for some time. You might consider using single dispatch instead: https://docs.python.org/3/library/functools.html#functools.singledispatch -- Steven D'Aprano "Ever

Re: Pylint false positives

2018-08-16 Thread Steven D'Aprano
so in practice, I probably wouldn't switch to a factory solution for merely four methods with empty bodies. But I certainly would for eight. When making this trade-off, "my developers don't understand Python's execution model or its dynamic features" is not a good reason to stick to large amounts of mindless code. That's a good reason to send the developer in question to a good Python course to update their skills. (Of course if you can't do this for political or budget reasons, I sympathise.) -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Program to output a subset of the composite numbers

2018-08-15 Thread Steven D'Aprano
starting with: [] [] [8, 9] [] [14, 15] etc. Take care though: I have not tested this code. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Pylint false positives

2018-08-15 Thread Steven D'Aprano
On Tue, 14 Aug 2018 15:18:13 +, Jon Ribbens wrote: > On 2018-08-14, Steven D'Aprano > wrote: >> If there really are a lot of such missing methods, I'd consider writing >> something like this: >> >> class A: >> def __init__(self, ...): &

Re: Pylint false positives

2018-08-14 Thread Steven D'Aprano
o locals works inside the class body. locals()[name] = inner del inner, name # Clean up the class namespace. def concrete_method_a(self): ... although to be honest I'm not sure if that would be enough to stop PyLint from complaining. -- Steven D'Aprano "

Re: Python-Tkinter issue. Multiple overlaping event routines called by single click

2018-08-11 Thread Steven D'Aprano
m/a/12357536 but since the description of the problem is so vague, it is hard to tell exactly what's happening. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Python-Tkinter issue. Multiple overlaping event routines called by single click

2018-08-11 Thread Steven D'Aprano
seems like an interesting experiment... put time.sleep(0.3) at the end of the event handler and see what happens. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Can't figure out how to do something using ctypes (and maybe struct?)

2018-08-10 Thread Steven D'Aprano
(Events) 508 Unless that's what you intended, you ought to move the class outside of the function. class Events(ctypes.Structure): _fields_ = [ ... ] def mkVstEvents(events): return Events( ... ) -- Steven D'Aprano "Ever since I learned about confirmati

Re: name 'aLOCK' is not defined When I add aLOCK = threading.RLock() behind if __name__ == "__main__"

2018-08-09 Thread Steven D'Aprano
>> global. > > When something goes wrong in an unexpected way: test your assumptions > ;-) xuanwu348's assumptions are correct. aLock is a global, in both positions. The problem is not the scope of the variable, but whether or not the variable is assigned to or not. --

RFC -- custom operators

2018-08-07 Thread Steven D'Aprano
es where the code is improved and made more expressive by using operator syntax and existing operators aren't sufficient. (If there aren't any such use-cases, then there's no need for custom operators.) Thoughts? -- Steven D'Aprano "Ever since I learned ab

Re: NLTK

2018-08-06 Thread Steven D'Aprano
tion isn't called "word-tokenize". That would mean "word subtract tokenize" in Python code. Do you mean word_tokenize? Have you compared the output of the two and looked at how they differ? If there is too much output to compare by eye, you could convert to sets and ch

Re: machine learning forums

2018-08-05 Thread Steven D'Aprano
cated machine-learning site, "Cross Validated": https://meta.stackexchange.com/questions/130524/which-stack-exchange- website-for-machine-learning-and-computational-algorithms https://meta.stackexchange.com/questions/227757/where-to-ask-basic- questions-about-machine-learning -- Steven

Re: beware of linked in - mail used on this list

2018-08-02 Thread Steven D'Aprano
from people who I don't know from LinkedIn, and most of them don't even know they sent them. I got three from you yesterday. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Are dicts supposed to raise comparison errors

2018-08-02 Thread Steven D'Aprano
ample opportunity for code to accidentally compare bytes and text even in pure Python 3 code, e.g. comparing data read from files reading from files which are supposed to be opened in the same binary/text mode but aren't. -- Steven D'Aprano "Ever since I learned about confirmatio

Re: Are dicts supposed to raise comparison errors

2018-08-02 Thread Steven D'Aprano
. And my point was that ignoring warnings is not the right approach. Suppressing them on a case-by-case basis (if possible) is one thing, but a blanket suppression goes to far, for the reasons I gave earlier. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've be

Re: Are dicts supposed to raise comparison errors

2018-08-01 Thread Steven D'Aprano
actual problem; - or it is a false positive which (if unfixed) distracts attention and encourages a blasé attitude which could easily lead to problems in the future. Warnings are a code smell. Avoiding warnings is a way of "working clean": https://blog.codinghorror.com/programmer

Re: Checking whether type is None

2018-07-28 Thread Steven D'Aprano
_thing = None > >>> type(some_thing).__str__(some_thing) > 'None' > > Equally weird, I'd say, but what the heck... class Foo: def __str__(self): return 'None' -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Checking whether type is None

2018-07-25 Thread Steven D'Aprano
s. It is wrong (in other words, it doesn't work) because it allows non-None objects to masquerade as None and pretend to be what they are not. If that's your intent, then of course you may do so. But without a comment explaining your intent, don't be surprised if more experienced P

Re: Checking whether type is None

2018-07-24 Thread Steven D'Aprano
hese days, that is rarely what we need now. The usual way to check a type is: isinstance(something, dict) but even that should be rare. If you find yourself doing lots of type checking, using isinstance() or type(), then you're probably writing slow, inconvenient Python code.

Re: Python 2.7.14 and Python 3.6.0 netcdf4

2018-07-23 Thread Steven D'Aprano
use you have the Python 2.7 version of the netCDF4 module installed in the Python 2.7 environment, doesn't mean it will magically work for Python 3.6. You have to install the module for 3.6 as well. How did you install it for Python 2.7? -- Steven D'Aprano "Ever since I

Re: coding style - where to declare variables

2018-07-23 Thread Steven D'Aprano
On Mon, 23 Jul 2018 14:39:56 +0300, Marko Rauhamaa wrote: > Steven D'Aprano : > >> Lambda calculus has the concept of a binding operator, which is >> effectively an assignment operator: it takes a variable and a value and >> binds the value to the variable, changi

Re: coding style - where to declare variables

2018-07-23 Thread Steven D'Aprano
s on a long paper tape, and an analog computer emulating Python would use I-have-no-idea. Clockwork? Hydraulics? https://en.wikipedia.org/wiki/MONIAC https://makezine.com/2012/01/24/early-russian-hydraulic-computer/ [2] Except by dropping into ctypes or some other interface to the implementati

Re: coding style - where to declare variables

2018-07-23 Thread Steven D'Aprano
different. [1] What, all of them? Even those with a comp sci PhD and 40 years programming experience in two dozen different languages? -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: coding style - where to declare variables

2018-07-23 Thread Steven D'Aprano
On Mon, 23 Jul 2018 20:24:30 +1200, Gregory Ewing wrote: > Steven D'Aprano wrote: >> So let me see if I understand your argument... >> >> - we should stop using the term "binding", because it means >> nothing different from assignment; >> -

Re: coding style - where to declare variables

2018-07-22 Thread Steven D'Aprano
and Python are the ones that are not "common". Indeed. Its not just older languages from the 60s and 70s with value-type variables. Newer languages intended as systems languages, like Rust and Go, do the same. -- Steven D'Aprano "Ever since I learned about confirmation bias

Re: coding style - where to declare variables

2018-07-22 Thread Steven D'Aprano
e. the "variables are a named box at a fixed memory location" model) include Algol, Pascal, Modula-3, C, C++, C#, Objective C, D, Swift, COBOL, Forth, Ada, PL/I, Rust and many others. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: coding style - where to declare variables

2018-07-22 Thread Steven D'Aprano
.k.a. "assignment") comes from lambda calculus; - which has no assignment (a.k.a. "binding"). Which leads us to the conclusion that lambda calculus both has and doesn't have binding a.k.a. assignment at the same time. Perhaps it is a quantum phenomenon. Are you happy with th

Re: Non-GUI, single processort inter process massaging - how?

2018-07-21 Thread Steven D'Aprano
nt the process ID. Let's say it prints 12345, over in another terminal, you can run: kill -USR1 12345 kill -USR2 12345 to send the appropriate signals. To do this programmatically from another Python script, use the os.kill() function. https://docs.python.org/3/library/signal.html

Re: Better way / regex to extract values form a dictionary

2018-07-21 Thread Steven D'Aprano
= os.path.basename(path) print filename # prints 'test04_Failures.log' testcase, remaining_junk = filename.split('_', 1) print testcase # prints 'test04' -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: try except inside a with open

2018-07-20 Thread Steven D'Aprano
try and expect in a 'with open' function as shown in > the below example code . Yes. > (2) If I hit any other exceptions say Value-error can I catch them as > show below If you hit ValueError, that is almost always a bug in your code. That's exactly the sort of thing you *shouldn't* be covering up with an except clause unless you really know what you are doing. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: [OT] Bit twiddling homework

2018-07-19 Thread Steven D'Aprano
On Fri, 20 Jul 2018 08:25:04 +0200, Brian Oney via Python-list wrote: > PS: Can I twiddle bits in Python? Yes. These operators work on ints: bitwise AND: & bitwise OR: | bitwise XOR: ^ -- Steven D'Aprano "Ever since I learned about confirmation bias, I&

Re: Glyphs and graphemes [was Re: Cult-like behaviour]

2018-07-19 Thread Steven D'Aprano
> speaker) In English, that would be "shop assistant". "Assist shop" would be grammatically incorrect: it should be written as "assist the shop", meaning "help the shop". Relevant: https://www.theatlantic.com/technology/archive/2018/01/the-shallowness-of-google-translate/551570/ -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: test for absence of infinite loop

2018-07-17 Thread Steven D'Aprano
times deal with that sort of thing is to re-write selected potentially-infinite loops: while condition: # condition may never become False do something to something like this: for counter in range(1000): if not condition: break do something else: raise TooManyIterationsErr

Re: Glyphs and graphemes [was Re: Cult-like behaviour]

2018-07-17 Thread Steven D'Aprano
-adding % support for byte strings) they will consider them, but going back to the Python 2 misdesign is off the table. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Glyphs and graphemes [was Re: Cult-like behaviour]

2018-07-17 Thread Steven D'Aprano
ion in the string object, as they do now. It might even be more compact, although a naive implementation would lose the ability to do constant time indexing into strings. That might be a tradeoff worth keeping, if indexing remained sufficiently fast. -- Steven D'Aprano "Ever

Re: Glyphs and graphemes [was Re: Cult-like behaviour]

2018-07-17 Thread Steven D'Aprano
vert 'int' object to str implicitly Python strings are sequences of abstract characters. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Glyphs and graphemes [was Re: Cult-like behaviour]

2018-07-17 Thread Steven D'Aprano
On Tue, 17 Jul 2018 08:26:45 +0300, Marko Rauhamaa wrote: > Steven D'Aprano : >> On Mon, 16 Jul 2018 22:51:32 +0300, Marko Rauhamaa wrote: >>> UTF-8 bytes can only represent the first 128 code points of Unicode. >> >> This is DailyWTF material. Perhaps y

Re: Glyphs and graphemes [was Re: Cult-like behaviour]

2018-07-17 Thread Steven D'Aprano
On Mon, 16 Jul 2018 21:25:20 -0500, Tim Chase wrote: > On 2018-07-17 01:08, Steven D'Aprano wrote: >> In English, I think most people would prefer to use a different term >> for whatever "sh" and "ch" represent than "character". > >

Re: Glyphs and graphemes [was Re: Cult-like behaviour]

2018-07-17 Thread Steven D'Aprano
On Mon, 16 Jul 2018 21:48:42 -0400, Richard Damon wrote: >> On Jul 16, 2018, at 9:21 PM, Steven D'Aprano >> wrote: >> >>> On Mon, 16 Jul 2018 19:02:36 -0400, Richard Damon wrote: >>> >>> You are defining a variable/fixed width codepoint set

Re: Glyphs and graphemes [was Re: Cult-like behaviour]

2018-07-16 Thread Steven D'Aprano
even wrong. Of course a *single* byte cannot, but a single byte is not "UTF-8 bytes". -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Glyphs and graphemes [was Re: Cult-like behaviour]

2018-07-16 Thread Steven D'Aprano
nits, and from 1 to 4 code units per code point; UTF-16 uses 2-byte code units (a 16-bit word), and 1 or 2 words per code point; UTF-32 uses 4-byte code units (a 32-bit word), and only ever a single code unit for every code point. -- Steven D'Aprano "Ever since I learned about

Re: Glyphs and graphemes [was Re: Cult-like behaviour]

2018-07-16 Thread Steven D'Aprano
veryone just used ASCII. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Cult-like behaviour [was Re: Kindness]

2018-07-16 Thread Steven D'Aprano
ily dealt with by a helper function. That *is* a nice example of where byte strings in Python 3 aren't as nice as in Python 2. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Glyphs and graphemes [was Re: Cult-like behaviour]

2018-07-16 Thread Steven D'Aprano
On Tue, 17 Jul 2018 06:15:25 +1000, Chris Angelico wrote: > On Tue, Jul 17, 2018 at 4:55 AM, Steven D'Aprano > wrote: >> There is nothing special about diacritics such that we ought to treat >> some combinations like "Ch" (two code points = one character) as &quo

Unicode is not UTF-32 [was Re: Cult-like behaviour]

2018-07-16 Thread Steven D'Aprano
nsidered to be a single unit of language, which some people might choose to call a character. (But not a single letter, naturally.) If you don't like that example, "qu" is probably a better one: aside from acronyms and loan words, no modern English word can fail to follo

Python 4000 was Re: [SUSPICIOUS MESSAGE] Re: Cult-like behaviour]

2018-07-16 Thread Steven D'Aprano
thon 3000'. Call it 'a mythical > Python 4000', if you must use such a term. I prefer to say Python 5000, to make it even more clear that should such a thing happen again, it will be a *REALLY* long time from now. -- Steven D'Aprano "Ever since I learned about confirm

Re: Users banned

2018-07-16 Thread Steven D'Aprano
ave words for that. There's no statute of limitation for murder, but surely "being obnoxious on the internet" ought to come with a fairly short period of forgiveness. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Glyphs and graphemes [was Re: Cult-like behaviour]

2018-07-16 Thread Steven D'Aprano
so is just special pleading. And the thing about special pleading is that we're not obliged to accept it. Plead as much as you like, the answer is still no. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Unicode [was Re: Cult-like behaviour]

2018-07-16 Thread Steven D'Aprano
and in for any string handling on ASCII over print("Hello World!") which works just as well if you control the data you are working with and know that it is pure ASCII. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Glyphs and graphemes [was Re: Cult-like behaviour]

2018-07-16 Thread Steven D'Aprano
On Mon, 16 Jul 2018 13:11:23 -0400, Richard Damon wrote: >> On Jul 16, 2018, at 12:51 PM, Steven D'Aprano >> wrote: >> >>> On Mon, 16 Jul 2018 00:28:39 +0300, Marko Rauhamaa wrote: >>> >>> if your new system used Python3's UTF-32 stri

Re: Unicode [was Re: Cult-like behaviour]

2018-07-16 Thread Steven D'Aprano
tter "V", although that's non-standard. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Glyphs and graphemes [was Re: Cult-like behaviour]

2018-07-16 Thread Steven D'Aprano
ebody who insists that because Python's float data type doesn't support full CAS (computer algebra system) and theorem prover, its useless and a step backwards and we should abandon IEEE-754 float semantics and let users implement their own floating point maths using nothing but fixed

I18N and Unicode [was Re: Cult-like behaviour]

2018-07-16 Thread Steven D'Aprano
roups of users who share a single character set, even ASCII. My application might display "Rubbish Bin" in the UK and Australia and "Trash Can" in the USA. If you think that Unicode is about internationalization, you are labouring under serious misapprehensions about

Re: Cult-like behaviour [was Re: Kindness]

2018-07-16 Thread Steven D'Aprano
label your output in Khmer, Hiragana and Gujarati if you don't want to. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Re: Unicode [was Re: Cult-like behaviour]

2018-07-16 Thread Steven D'Aprano
On Mon, 16 Jul 2018 14:17:35 +, Dan Sommers wrote: > On Mon, 16 Jul 2018 10:39:49 +0000, Steven D'Aprano wrote: > >> ... people who think that if ISO-8859-7 was good enough for Jesus ... > > It may have been good enough for his disciples, but Jesus spoke Aramaic. The

Re: Getting process details on an operating system process/question answer by vouce

2018-07-16 Thread Steven D'Aprano
xplain: > > Ask: how was your day > record answer in voice translate it via google ask new question Sorry, I don't understand this. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Unicode [was Re: Cult-like behaviour]

2018-07-16 Thread Steven D'Aprano
et to the crux of the matter. It isn't really the technical issues of Unicode that annoy you. It is the loss of privilege that you, as an ASCII user, no longer get to dismiss 90% of the world as beneath your notice. Nice. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list

Unicode [was Re: Cult-like behaviour]

2018-07-16 Thread Steven D'Aprano
On Sun, 15 Jul 2018 17:39:55 -0700, Jim Lee wrote: > On 07/15/18 17:18, Steven D'Aprano wrote: >> On Sun, 15 Jul 2018 16:08:15 -0700, Jim Lee wrote: >> >>> Python3 is intrinsically tied to Unicode for string handling. >>> Therefore, the Python programmer

Re: Cult-like behaviour [was Re: Kindness]

2018-07-15 Thread Steven D'Aprano
ate my point with Python code since Python won't let me deal with > strings without also dealing with Unicode. Nonsense. b"Look ma, a Python 2 style ASCII string." -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere.&q

Re: Cult-like behaviour [was Re: Kindness]

2018-07-15 Thread Steven D'Aprano
ming tasks.  For a > great deal more, it's absolutely necessary.  That why I said a "smart" > language would make it easy to turn on and off. You actually said that I18N features should be able to be turned on and off. Unicode and I18N are unrelated. -- Steven D&

  1   2   3   4   5   6   7   8   9   10   >