Re: Beautiful Soup - close tags more promptly?

2022-10-25 Thread Tim Delaney
iving of malformed input and edge cases. I use html5lib - it's fast enough for what I do, and the most likely to return results matching what the author saw when they maybe tried it in a single web browser. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Randomizing Strings In A Microservices World

2019-12-09 Thread Tim Delaney
e the string being repeated. > 10 digits is only 9. That's not a very big number. Forget nanoseconds since the epoch, that won't currently give you seconds since the epoch - let alone combining with any other identifier. $ date '+%s' 1575942612 Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

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

2018-02-18 Thread Tim Delaney
r: __class__ assignment only supported for heap types or ModuleType subclasses In some implementations it is possible to subvert the Python typing system by stepping out of Python code and into (for example) a C extension, but that does not make Python *the language* weakly typed. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

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

2018-01-28 Thread Tim Delaney
On 29 January 2018 at 11:27, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > On Mon, 29 Jan 2018 08:55:54 +1100, Tim Delaney wrote: > > > I got back a Word document containing about 10 screenshots where they'd > > apparently taken a screenshot,

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

2018-01-28 Thread Tim Delaney
otherwise, this type of thing keeps happening. BTW: I have nothing to do with the final persistence format of the data, but in practice I've had to learn the DB schema and stored procedures for everything I support. Strangely the DB team don't have to learn my parts ... Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

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

2017-10-04 Thread Tim Delaney
stralians would say that writing "an herb" is a mistake since we pronounce the "h", but millions of people elsewhere would disagree with us. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: scandir slower than listdir

2017-07-20 Thread Tim Delaney
e test of the way both functions would normally be used would be to iterate over the results instead of eagerly building a list. In this test you would also expect scandir() to use less memory for a large directory. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Awful code of the week

2016-08-07 Thread Tim Delaney
ith del) and avoids having to think up another name for a very temporary structure (names are hard). And I would include a comment explaining the reuse of the name. The alternative would be something like (replace first line by something complex ...): near_limit_list = [1] near_limit = len(near

Re: [OT] Compression of random binary data

2016-07-13 Thread Tim Delaney
le was to pick a book off a library shelf). But unless otherwise qualified, a claim of being able to compress random data is taken to mean any and all sets of random data. Anyway, that's going to be my only contribution to this thread. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: [OT] Java generics (was: Guido sees the light: PEP 8 updated)

2016-04-18 Thread Tim Delaney
On 18 April 2016 at 09:30, Chris Angelico wrote: > On Mon, Apr 18, 2016 at 8:02 AM, Tim Delaney > wrote: > > I also wouldn't describe Java as a > > "perfectly good language" - it is at best a compromise language that just > > happened to be heavily

[OT] Java generics (was: Guido sees the light: PEP 8 updated)

2016-04-17 Thread Tim Delaney
ed language) but worse in others (esp. that they're implemented by erasure). I also wouldn't describe Java as a "perfectly good language" - it is at best a compromise language that just happened to be heavily promoted and accepted at the right time. Python is *much* closer

Re: Guido sees the light: PEP 8 updated

2016-04-16 Thread Tim Delaney
me hijinks in the settings > to expand it. > Personally, I've given up on 80 characters (or even 120 in rare cases) for Java code (esp method declarations), where just specifying the generics can often take almost that much. But for Python code it's generally fairly easy to break a line in a natural place. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: How to read from a file to an arbitrary delimiter efficiently?

2016-02-28 Thread Tim Delaney
probably going to be most efficient whilst leaving the file position just after the delimiter. If reading from a stream, I think Chris' read a chunk and maintain an internal buffer, and don't give access to the underlying stream. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: What use for reversed()?

2015-05-31 Thread Tim Delaney
On 1 June 2015 at 10:30, Mark Lawrence wrote: > On 01/06/2015 00:23, Tim Delaney wrote: > >> The for statement must have a colon at the end of line e.g. a complete >> for statement and block is: >> >> for br in b: >> print br >> >> This will o

Re: What use for reversed()?

2015-05-31 Thread Tim Delaney
print br This will output the characters one per line (on Python 3.x), since that is what the reversed() iterator will return. You will need to do something else to get it back to a single string. Have you read through the python tutorials? https://docs.python.org/3/tutorial/ or for Python 2

Re: Delivery Status Notification (Failure)

2015-05-11 Thread Tim Delaney
@ in the future, but please do not CC the list. My spam filters have learned to filter out most job spam automatically by now, but it doesn't filter out your reply. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: (Still OT) Nationalism, language and monoculture [was Re: Python Worst Practices]

2015-03-04 Thread Tim Delaney
On 5 March 2015 at 09:39, Emile van Sebille wrote: > On 3/4/2015 12:40 PM, Tim Delaney wrote: > >> A related thing is when you have multiple multi-lingual people talking >> together where at least two of their languages match (or are close >> enough for most uses e.g

Re: (Still OT) Nationalism, language and monoculture [was Re: Python Worst Practices]

2015-03-04 Thread Tim Delaney
they're trying to say, and no one will involved realise. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Style question: Importing modules from packages - 'from' vs 'as'

2014-12-03 Thread Tim Delaney
e disadvantage of the former is that if you *don't* want to rename, it violates DRY (don't repeat yourself). The difference is so marginal that I'd leave it to personal preference, and wouldn't pull someone up for either in a code review. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Classes

2014-11-02 Thread Tim Delaney
ultitude of uses for user interfaces, whilst other quadrilaterals are somewhat less useful. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Lazy-evaluation lists/dictionaries

2014-10-26 Thread Tim Delaney
massively inefficient. > Why not put proxy objects into the list/dict? Have a look at the weakref module for an API that may be suitable for such proxy objects (if you used the same API, that would also allow you to transparently use weakrefs in your lists/dicts). Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: [OT] spelling colour / color was Re: Toggle

2014-10-09 Thread Tim Delaney
o have some methods use "z" and others "s" in the same package. So since I'm currently working for a US company I have to consciously remind myself to use their abominations ;) Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: [OT] Question about Git branches

2014-09-16 Thread Tim Delaney
ranch repo: [feature_branch_repo:65179] [feature_branch]> hg relink default relinking d:\home\repos\feature_branch_repo\.hg/store to d:\home\repos\default_repo\.hg/store tip has 22680 files, estimated total number of files: 34020 collected 229184 candidate storage files pruned down to 49838 probabl

Re: [OT] Question about Git branches

2014-09-16 Thread Tim Delaney
sy to switch between tasks - I just update to a different changeset (normally the tip of a named branch) and force a refresh in my IDE. When I'm happy, I merge into the feature branch, then pull the necessary changesets into other feature branch repos to merge/graft as appropriate. Branches and clones are two different ways of organising, and I find that things work best for me when I use both. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: hg, git, fossil, ...

2014-08-28 Thread Tim Delaney
the changeset if you don't want the graft as-is. It's a bit messy, and could cause problems if you later do a merge that includes the originally-grafted changeset on top of the amended changeset (since the changes committed to the amended changeset will be considered during the merge). Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Why Python 4.0 won't be like Python 3.0

2014-08-18 Thread Tim Delaney
t for major.minor.1. What is more important is that minor and patch version increases should avoid introducing breakage and incompatibilities wherever possible (security fixes are one reason to allow incompatibility in a minor release). BTW I agree with the idea that 4.0 would be an appropriate

Re: Python and IDEs [was Re: Python 3 is killing Python]

2014-07-19 Thread Tim Delaney
ok shuts down after 15 minutes. I'm surprised at how well I > was able to set up a equivalent programming environment on Windows. I advise anyone who works cross-platform to install MSYS on their Windows boxes (for the simplest, most consistent behaviour ignore rxvt and just launch bash -l - i directly). Or use cygwin if you prefer. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Python and IDEs [was Re: Python 3 is killing Python]

2014-07-19 Thread Tim Delaney
On 20 July 2014 09:19, Chris Angelico wrote: > On Sun, Jul 20, 2014 at 7:50 AM, Tim Delaney > wrote: > > IMO there is no project so modest that it doesn't require version > control. > > Especially since version control is as simple as: > > > > cd projec

Re: Python and IDEs [was Re: Python 3 is killing Python]

2014-07-19 Thread Tim Delaney
ect hg init hg add hg commit FWIW I also don't find a need for an IDE for Python - I'm quite happy using EditPlus (which I preferred enough to other alternatives on Windows to pay for many years ago). Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: PyPy3 2.3.1 released

2014-06-20 Thread Tim Delaney
Congratulations. I can't find the details of PyPy3's unicode implementation documented anywhere. Is it equivalent to: - a Python 3.2 narrow build - a Python 3.2 wide build - PEP 393 - something else? Cheers, Tim Delaney On 21 June 2014 06:32, Philip Jen

Re: try/except/finally

2014-06-10 Thread Tim Delaney
on how easily their fur gets up your nose). Now, a cat *standing* on the keyboard, between you and the monitor, and rubbing his head against your hands, is a whole other matter. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Micro Python -- a lean and efficient implementation of Python 3

2014-06-10 Thread Tim Delaney
oll about the FSR. Please don't reply to him (and preferably add him to your killfile). Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.2 has some deadly infection

2014-06-02 Thread Tim Delaney
On 2 June 2014 17:45, Wolfgang Maier < wolfgang.ma...@biologie.uni-freiburg.de> wrote: > Tim Delaney gmail.com> writes: > > > For some purposes, there needs to be a way to treat an arbitrary stream > of > bytes as an arbitrary stream of 8-bit characters. iso-latin-1

Re: Python 3.2 has some deadly infection

2014-06-01 Thread Tim Delaney
On 2 June 2014 11:14, Steven D'Aprano wrote: > On Mon, 02 Jun 2014 08:54:33 +1000, Tim Delaney wrote: > > I'm currently working on a product that interacts with lots of other > > products. These other products can be using any encoding - but most of > > the f

Re: Python 3.2 has some deadly infection

2014-06-01 Thread Tim Delaney
efault would be the most sensible option (effectively treating everything as bytes), with the option for another encoding if/when more information is known (e.g. there's often a call to return the encoding, and the output of that call is guaranteed to be ASCII). Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: singleton ... again

2014-02-13 Thread Tim Delaney
machinery - no need to reinvent the wheel. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: singleton ... again

2014-02-12 Thread Tim Delaney
hon, because Python either already has various patterns implemented, or obviates the need for them. For example, if you really need a singleton (answer - you don't) just use a module attribute. Functions as objects and iterators being so pervasive means that visitor and related patterns are just a normal style of programming, instead of having to be explicit. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Python programming

2014-02-12 Thread Tim Delaney
On 13 February 2014 08:02, Tim Delaney wrote: > I received a copy of "The Beginners Computer Handbook: Understanding & > programming the micro" (Judy Tatchell and Bill Bennet, edited by Lisa Watts > - ISBN 0860206947) > I should have noted that the examples were all B

Re: Newcomer Help

2014-02-12 Thread Tim Delaney
;s worth the effort, but it can be really hard when you've got an already existing top-posted email thread with people using bizarre fonts and colours throughout. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Python programming

2014-02-12 Thread Tim Delaney
w to be more than just a programmer; came out the other end a senior developer/technical lead and effective communicator. And that's how I learned to program. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: __init__ is the initialiser

2014-02-02 Thread Tim Delaney
e it will call the subclass method before the subclass constructor is actually run, meaning that instance variables will have their default values (null for objects). When the base class constructor is eventually run the instance variables will be assigned the values in the class definition (replacing a

Re: __init__ is the initialiser

2014-02-01 Thread Tim Delaney
mentation is a bug in either the documentation or the implementation. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to protect python source code by compiling it to .pyc or .pyo?

2014-01-17 Thread Tim Delaney
d obtain the data in an unambiguous manner to verify against my parser. The only way to truly protect code is to not ship any version of it (compiled or otherwise), but have the important parts hosted remotely under your control (and do your best to ensure it doesn't become compromised). Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Blog "about python 3"

2014-01-07 Thread Tim Delaney
orities for Unicode handling in Python were: 1. Correctness a. all code points must be handled correctly; b. it must not be possible to obtain part of a code point (e.g. the first byte only of a multi-byte code point); 2. No change in the Big O characteristics of string operations e.g. indexing must remain O(1); 3. Reduced memory use in most cases. It is impossible for UTF-8 to meet both criteria 1b and 2 without additional auxiliary data (which uses more memory and increases complexity of the implementation). The FSR meets all 3 criteria. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: [OT]Royal pardon for codebreaker Turing

2013-12-27 Thread Tim Delaney
t the rhetoric and > laws coming out of the Kremlin are just like that coming out of the > Reichstag in the thirties. You are of course correct - I was still groggy from waking up when I replied, and focused on the element that I had been most exposed to. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: [OT]Royal pardon for codebreaker Turing

2013-12-27 Thread Tim Delaney
mir Putin into a homosexual icon (search "last leg sochi" without the quotes). Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-11 Thread Tim Delaney
On 12 December 2013 03:25, Chris Angelico wrote: > On Thu, Dec 12, 2013 at 3:18 AM, Mark Lawrence > wrote: > > On 11/12/2013 16:04, Chris Angelico wrote: > >> > >> I strongly believe that a career > >> programmer should learn as many languages and styles as possible, but > >> most of them can wa

Re: Python Unicode handling wins again -- mostly

2013-12-01 Thread Tim Delaney
His initial postings did lead to a regression being found. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Unicode handling wins again -- mostly

2013-12-01 Thread Tim Delaney
a troll? Probably because out of all his baseless complaints about the FSR, he *did* have one valid point about performance that has now been fixed. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Jython - Can't access enumerations?

2013-11-29 Thread Tim Delaney
On 30 November 2013 03:15, Eamonn Rea wrote: > Ok, here's the code: > [elided] > As I said, please also show the *exact* error - copy and paste the stack trace. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Jython - Can't access enumerations?

2013-11-28 Thread Tim Delaney
either with LibGDX or (more likely) way you are using it. Please post a minimal example that demonstrates the problem plus the exact error message you get (I don't know LibGLX at all, but someone else might, plus trimming it down to a minimal example may reveal the problem to you). Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Cracking hashes with Python

2013-11-26 Thread Tim Delaney
ot;stumped" is actually coming from the problem of a plough getting stuck on a stump (i.e. can't progress any further). Not much of an issue anymore since the invention of the stump-jump plough: https://en.wikipedia.org/wiki/Stump-jump_plough (Looked it up, my guess is considered the most likely origin of the term). Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-26 Thread Tim Delaney
aying something like "I think I can help here, but I'm confused about - could you or someone else clarify please?" And if an unfamiliar dialect annoys you, killfile the person. No skin off my nose. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Off-topic: Aussie place names [was Re: Automation]

2013-11-20 Thread Tim Delaney
riginal_origin Just noticed that my town was missing - added it: https://en.wikipedia.org/wiki/Mittagong,_New_South_Wales Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: To whoever hacked into my Database

2013-11-08 Thread Tim Delaney
e stranger to be "exposing" that data? Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: To whoever hacked into my Database

2013-11-07 Thread Tim Delaney
On 8 November 2013 09:45, Tim Delaney wrote: > On 8 November 2013 09:18, Νίκος Αλεξόπουλος wrote: > >> I feel a bit proud because as it seems i have manages to secure it more >> tight. All i need to do was to validate user input data, so the hacker >> won't be able

Re: To whoever hacked into my Database

2013-11-07 Thread Tim Delaney
g is opening your customers up to potentially disastrous situations and yourself to lawsuits. It's not a question of *if*, but *when* one of your customers is compromised to the extent that they decide to take it out of you. Also, you're an embarrassment to our profession. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: personal library

2013-10-30 Thread Tim Delaney
On 31 October 2013 08:43, Tim Delaney wrote: > On 31 October 2013 08:31, Chris Angelico wrote: > >> On Thu, Oct 31, 2013 at 7:19 AM, Tim Delaney >> wrote: >> > What it comes down to for me is that Mercurial usage fits in my head >> and I >> > rarely

Re: personal library

2013-10-30 Thread Tim Delaney
On 31 October 2013 08:31, Chris Angelico wrote: > On Thu, Oct 31, 2013 at 7:19 AM, Tim Delaney > wrote: > > What it comes down to for me is that Mercurial usage fits in my head and > I > > rarely have to go to the docs, whereas with Git I have to constantly go > to >

Re: personal library

2013-10-30 Thread Tim Delaney
extensively used the top two contenders (Git and Mercurial) I would strongly advise you to use Mercurial. What it comes down to for me is that Mercurial usage fits in my head and I rarely have to go to the docs, whereas with Git I have to constantly go to the docs for anything but the most tri

Re: Algorithm that makes maximum compression of completly diffused data.

2013-10-30 Thread Tim Delaney
o this on truly random data, you're probably wrong - either your data is has patterns the algorithm can exploit, or you've simply been lucky with the randomness of your data so far. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Check if this basic Python script is coded right

2013-10-27 Thread Tim Delaney
en 0-201" (inclusive) then whoever fixes it might naively just add one to the existing code, giving an incorrect result. Obviously I'm ignoring the possibility of appropriate unit tests to prevent this - just looking at the code itself. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Front-end to GCC

2013-10-25 Thread Tim Delaney
after 4 hours sleep - my apologies to the list). Anyway, not going to get sucked into this bottomless hole. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Front-end to GCC

2013-10-25 Thread Tim Delaney
as I'm now starting to suspect, possibly a bot, but I'll give him (it?) this one chance to show the capability to read and learn. http://en.wikipedia.org/wiki/Hexspeak Search for 0xBAADF00D; 0xBADDCAFE; and (in particular) OxDEADBEEF. These are historical examples of this techniqu

Re: Sexism in the Ruby community: how does the Python community manage it?

2013-10-17 Thread Tim Delaney
laims to prefer an language named after a fish :-) > That would be https://en.wikipedia.org/wiki/Monty_Python not https://en.wikipedia.org/wiki/Pythonidae. The snake has been adopted as a mascot (see the Python icon) but is not the inspiration. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: JUST GOT HACKED

2013-10-01 Thread Tim Delaney
abase. And of course your database is so well locked down that no attacker with a login to it could then execute arbitrary code on your system. And there's also zero chance that your personal account login details are also available in plaintext somewhere that you're unaware of. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: JUST GOT HACKED

2013-10-01 Thread Tim Delaney
I'm not going to risk it by going there to check myself ... Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Do I really need a web framework?

2013-09-30 Thread Tim Delaney
ct? > > What do you suggest, keeping in mind that I am a newbie and that my > website project would be very simple and very small? > There is no *need* to use a web framework. But a web framework can make things a lot easier for you. Have a look at webapp2: http://webapp-impro

Re: Print statement not printing as it suppose to

2013-09-20 Thread Tim Delaney
red is %s" % (total,)) which will produce the same output on both Python 2 and Python 3. Note the double space before %s - that matches your print statement (there would be soft-space inserted in your print statement, which is another reason not to rely on print for anything other th

Re: PEP8 79 char max

2013-09-06 Thread Tim Delaney
> I'm just glad it's no longer 40-chars-per-column and purely > upper-case like the Apple ][+ on which I cut my programming teeth. > Couldn't you switch the ][+ into high-res mode? You could with the IIe. Made programming in DOS 3.3 BASIC so much nicer. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: Encapsulation unpythonic?

2013-09-01 Thread Tim Delaney
nk Roy is referring to the fact that attribute access is implemented via __getattr__ / __getattribute__ / __setattr__ / __delattr__. From one point of view, he's absolutely correct - nearly all attributes are accessed via getters/setters in Python. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Encapsulation unpythonic?

2013-08-31 Thread Tim Delaney
ast the Object reference 'a' or use reflection to call methods on it or access it's members (think of it as Python does reflection automatically for you). Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is str(None) == 'None' and not an empty string?

2013-08-29 Thread Tim Delaney
; not None else '') instead. Not a major inconvenience, but enough to > make me wonder if there could be a better way. > There is. def format(value): if value is None: return '' return str(value) print(format(value)) This also allows you to format other types differently e.g. only output 2 decimal places for non-integer numeric types. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: New VPS Provider needed

2013-08-27 Thread Tim Delaney
PS provider's end. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Fast conversion of numbers to numerator/denominator pairs

2013-08-24 Thread Tim Delaney
On 25 August 2013 07:59, Tim Delaney wrote: > Breakdown of the above (for 19 digits): > > d.as_tuple() takes about 35% of the time. > > The multiply and add takes about 55% of the time. > > The exponentiation takes about 10% of the time. > Bah - sent before complete. Si

Re: Fast conversion of numbers to numerator/denominator pairs

2013-08-24 Thread Tim Delaney
he multiply and add takes about 55% of the time. The exponentiation takes about 10% of the time. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: RE Module Performance

2013-07-30 Thread Tim Delaney
ng that doing the above in any language which has immutable strings is completely insane you will have no credibility and the only interest anyone will pay to your posts is refuting your FUD so that people new to the language are not driven off by you. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Dihedral

2013-07-15 Thread Tim Delaney
passes the Turing test? > > Yes, absolutely. The original Turing test was defined in terms of five > minutes of analysis, and Dihedral and jmf have clearly been > indistinguishably human across that approximate period. > The big difference between them is that the jmfbot does not appear to evolve its routines in response to external sources - it seems to be stuck in a closed feedback loop. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: RE Module Performance

2013-07-13 Thread Tim Delaney
On 13 July 2013 09:16, MRAB wrote: > On 12/07/2013 23:16, Tim Delaney wrote: > >> On 13 July 2013 03:58, Devyn Collier Johnson > <mailto:devyncjohnson@gmail.**com >> wrote: >> >> >> Thanks for the thorough response. I learned a lot. You should writ

Re: RE Module Performance

2013-07-12 Thread Tim Delaney
e. If you are finding that regular expressions are taking too much time, have a look at the https://pypi.python.org/pypi/re2/ and https://pypi.python.org/pypi/regex/2013-06-26 modules to see if they already give you enough of a speedup. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Version Control Software

2013-06-15 Thread Tim Delaney
long as at some point I can sync the repositories, I can work away (on things that are not dependent on something new from upstream). Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Version Control Software

2013-06-14 Thread Tim Delaney
ing the Mercurial and CC clients in sync. Turns out that CCRC was the best option, as I was able to parse its local state files and work out what timestamp ClearCase thought its files should be, set it appropriately from a Mercurial extension and convince CCRC that really, only these files have change

Re: PyWart: The problem with "print"

2013-06-02 Thread Tim Delaney
tunately, by reducing to a single thread + single semaphore slot I was able to turn it from a Heisenbug to a 100% replicable bug. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-02 Thread Tim Delaney
On 3 June 2013 09:10, Tim Delaney wrote: > A programmer chooses his own clients, and you are the Atherton Wing to >> my Inara Serra. >> > > I've just been watching this train wreck (so glad I didn't get involved at > the start) but I have to say - that's br

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-02 Thread Tim Delaney
> > A programmer chooses his own clients, and you are the Atherton Wing to > my Inara Serra. > I've just been watching this train wreck (so glad I didn't get involved at the start) but I have to say - that's brilliant Chris. Thank you for starting my week off so

Re: is operator versus id() function

2013-04-05 Thread Tim Delaney
b90ebf2, Sep 29 2012, 10:57:17) [MSC v.1600 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> class A(object): ... def f(self): ... print("A") ... >>> a=A() >>> print(id(a.f) == id(a.f), a.f is a.f) True False >>> Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: "monty" < "python"

2013-03-20 Thread Tim Delaney
He has shown no inclination to attempt to *fix* the regression and is rapidly coming to be regarded as a troll by most participants in this list. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Instances as dictionary key, __hash__ and __eq__

2013-02-18 Thread Tim Delaney
st way is probably to have a _equal_fields() method that subclasses override, returning a tuple of the attributes that should be hashed. Then in __hash__() and __eq__ you iterate over the returned tuple, get the value for each attribute and either hash or compare. Of course, you have to take into account in __eq__ that the other instance may not have the same attributes (e.g. self is a subclass that uses extra attributes in its __hash__ and __eq__). Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: PyWart (Terminolgy): "Class"

2013-01-14 Thread Tim Delaney
On 15 January 2013 07:57, Chris Angelico wrote: > > Oh, and Dennis? Mal. Bad. From the Latin. :) > I was about to point out the same thing, using the same quote ;) Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: String manipulation in python..NEED HELP!!!!

2012-12-11 Thread Tim Delaney
the anti-pattern of string concatenation, not to encourage people to use it. As a real-world case, a bug was recently found in Mercurial where an operation on Windows was taking orders of magnitudes longer than on Linux due to use of string concatenation rather than the join idiom (from ~12 seconds spent on string concatenation to effectively zero). Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Python does not take up available physical memory

2012-10-21 Thread Tim Delaney
ntioned. One I haven't seen here yet (I may have missed it) is dumping the data into a database of some form and using it's capabilities. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Aggressive language on python-list

2012-10-13 Thread Tim Delaney
there is no reference to the troll/bot or any text from the troll/bot - fine. But any reference to the original will make it harder for those of us who use bayesian-based spam filtering. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Aggressive language on python-list

2012-10-13 Thread Tim Delaney
That's what they want - it gives them an audience. No matter how much you want to *just this once* respond to one, resist the urge. And if you can't prevent yourself from replying to someone who has quoted one in order to tell them that the person is a known troll/bot, tell them privately, not on the list. Cheers, Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212.

2012-09-29 Thread Tim Delaney
On 30 September 2012 09:26, Chris Angelico wrote: > On Sun, Sep 30, 2012 at 6:51 AM, Tim Delaney > wrote: > > Personally I voted for the Fierce Snake[1][2] as the delimiter, but it > was > > voted down as "not Pythonic" enough. > > I'm sure they were

Re: write a regex matches 800-555-1212, 555-1212, and also (800) 555-1212.

2012-09-29 Thread Tim Delaney
miter, but it was voted down as "not Pythonic" enough. I'm sure they were using that as a euphamism for "Python*ish*" though. [1] https://en.wikipedia.org/wiki/Inland_Taipan [2] It's is so pretty: https://upload.wikimedia.org/wikipedia/commons/f/fe/Fierce_Snake-Oxyuranus_microlepidotus.jpg Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: The opener parameter of Python 3 open() built-in

2012-09-05 Thread Tim Delaney
gt; that there is more risk of breakage just because one function is called > from a thread. > > Obviously monkey-patching the builtin module itself is much riskier, > because it doesn't just effect code in my module, it affects *everything*. It's not as though the op

[OT] git and hg in prompt (was: My first ever Python program, comments welcome)

2012-07-24 Thread Tim Delaney
27; -e '/^[^+-]/d' -e 's/+-/*/'`" echo "[${tracking}${uptodate}${branch}:${head}] " return 0 fi return 1 } function git_hg_ps1() { git_ps1 if [ $? -eq 0 ] ; then return 0 fi hg_ps1 return $? } export PS1='$(g

Re: cPython, IronPython, Jython, and PyPy (Oh my!)

2012-05-16 Thread Tim Delaney
if self.refs == 0: self.write_record() rec = record_weakrefs.get('record_name') if rec is None: rec = load_record() record_weakrefs.put('record_name', rec) with rec: do_stuff Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: cPython, IronPython, Jython, and PyPy (Oh my!)

2012-05-16 Thread Tim Delaney
ve" record? What is the problem if you get back a reference to an inactive record? And if there is indeed a problem, don't you already have a race condition on CPython? 1. Record is active; 2. Get reference to record through weak ref; 3. Record becomes inactive; 4. Start trying to

Re: why () is () and [] is [] work in other way?

2012-04-23 Thread Tim Delaney
hednan >except TypeError: >pass >return cache.setdefault(x, x) > > I hope, again, that I've demonstrated that we don't need to > canonicalize everything just to implement interning. Except that the above is a canonicalisation function. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   >