RE: super() and type()

2006-11-27 Thread Delaney
Carl Banks wrote: > Unfortunately, short of hackery, you're stuck with having to write out > super(C,self). For my version of that particular hackery ... http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286195 Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

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: 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: 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: 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: 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: 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: 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: 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-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

[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: 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

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: 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: 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: 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: 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: 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: 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: contextlib.contextmanager and try/finally

2012-01-31 Thread Tim Delaney
gt; ... > >>> import sys > >>> with f(): > ... sys.exit() > ... > bye > $ Note OTOH that os._exit() just terminates the process with no cleanup (this may be what you were thinking of): >>> from contextlib import contextmanager >>> @contextmanager ... def f(): ... try: ... yield ... finally: print "bye" ... >>> import os >>> with f(): ... os._exit(1) ... $ Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Iterate from 2nd element of a huge list

2012-01-31 Thread Tim Delaney
cated, isn't it? > If you are sure that mylist contains at least one element: >>> mylist = [1, 2, 3] >>> i = iter(mylist) >>> print next(i) 1 >>> for el in i: ... print el ... 2 3 Note: for older pythons, you may need i.next() instead of next(i)

Re: changing sys.path

2012-02-01 Thread Tim Delaney
ctly... > > That's what really puzzles me.. What could that be then? Post the actual code, plus traceback. We cannot help you without it. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Change os.makedirs to handle existing directory

2012-02-13 Thread Tim Delaney
rary/os.html?highlight=makedirs#os.makedirs Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Number of languages known [was Re: Python is readable] - somewhat OT

2012-03-24 Thread Tim Delaney
, etc) is IMO the most important skill for a developer to have. Pick it up quickly, become proficient with it, leave it alone for a couple of years, pick up the new version when you need/want it. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Number of languages known [was Re: Python is readable] - somewhat OT

2012-03-28 Thread Tim Delaney
On 25 March 2012 11:03, Tim Chase wrote: > On 03/24/12 17:08, Tim Delaney wrote: > >> Absolutely. 10 years ago (when I was just a young lad) I'd say that I'd >> *forgotten* at least 20 programming languages. That number has only >> increased. >> > &

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

2012-04-23 Thread Tim Delaney
kes the (sensible) choice to automatically intern short strings that look like names (in the Python sense) and leave everything else up to the programmer. It's possible for the programmer to manually intern their 1GB string, but they've then got to deal with the consequences of doing so. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

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

2012-04-23 Thread Tim Delaney
On 24 April 2012 09:08, Devin Jeanpierre wrote: > On Mon, Apr 23, 2012 at 6:26 PM, Tim Delaney > wrote: > > And doing that would make zero sense, because it directly contradicts the > > whole *point* of "is". The point of "is" is to tell you whether or no

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

2012-04-23 Thread Tim Delaney
On 24 April 2012 10:18, Robert Kern wrote: > On 4/24/12 1:03 AM, Tim Delaney wrote: > >> On 24 April 2012 09:08, Devin Jeanpierre > <mailto:jeanpierr...@gmail.com**>> wrote: >> >>On Mon, Apr 23, 2012 at 6:26 PM, Tim Delaney >>> <

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

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: 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: Why is this so much faster?

2011-06-02 Thread Tim Delaney
ram)) totalSum = sum(intermediateResult) # calculate rms return math.sqrt(totalSum / self.Area()) BTW, the following might (or might not) be faster again: # Pass a generator expression to sum() instead of manually summing def RMSBand(self, histogram): """Calculates the root-mean-squared value for the given colour stream histogram.""" totalSum = sum(h*(i**2) for (i, h) in enumerate(histogram)) # calculate rms return math.sqrt(totalSum / self.Area()) Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is this so much faster?

2011-06-03 Thread Tim Delaney
On 3 June 2011 19:05, Thomas Jollans wrote: > On Friday 03 June 2011, it occurred to Tim Delaney to exclaim: > > > Probably the biggest savings are list creating and jumping between C- and > > > Python-functions during the map call. The lambda is a Python function, > &

Re: Instituições que utilizam Python.

2011-08-29 Thread Tim Delaney
ogle.com.au/search?q=python+brasil. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: best python games?

2011-03-27 Thread Tim Delaney
included, and this has been used by fans to provide ongoing bugfixes and improvements. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: float("nan") in set or as key

2011-05-28 Thread Tim Delaney
test for uniqueness of keys or > elements. > > > >>> nan = float("nan") > >>> nan == nan > False > > In short, don't do that. There's a second part the mystery - sets and dictionaries (and I think lists) assume that identify implies equality (hence the second result). This was recently discussed on python-dev, and the decision was to leave things as-is. Tim Delaney -- http://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: 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: 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: 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: 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: 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

[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: [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

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: 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: 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

long time we haven't spoken ;)

2005-04-20 Thread Elbert Delaney
Daayuum bro You'll never guess what happened to me last week. Basically found a 18 + date site that doesn't charge anything. So many couples, guys and girls are there messaging and meeting eachother. And I'm certain there is someone (or more than one) for you. Although most of them want one-ni

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: 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: 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: 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: 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: 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: 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: 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: [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: [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: 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: 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: __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: __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: 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: 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: 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: 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: 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: 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
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: 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: 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: 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: 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-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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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
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: 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: 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-08 Thread Tim Delaney
e stranger to be "exposing" that data? 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
they're trying to say, and no one will involved realise. 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: 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: 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

  1   2   3   4   >