Re: Python List is Not Dead

2024-12-30 Thread Erik Max Francis via Python-list
list gatewayed to usenet though, there's really nothing so good as usenet for proper discourse (!). Hear, hear! -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && Skype erikmaxfrancis The quality

ANN: EmPy 4.2 -- a powerful, robust and mature templating system for Python

2024-08-25 Thread Erik Max Francis via Python-list
. See [Full list of changes between EmPy 3._x_ and 4.0](http://www.alcyone.com/software/empy/ANNOUNCE.html#all-changes) for a more comprehensive list. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W &am

ANN: EmPy 4.0.1

2024-01-01 Thread Erik Max Francis via Python-list
nges between EmPy 3._x_ and 4.0](http://www.alcyone.com/software/empy/ANNOUNCE.html#full-list-of-changes-between-empy-3-x-and-4-0) for a more comprehensive list. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57

python 3.9.12 and python 3.10

2022-05-03 Thread Dave Francis
3.9 appeared with my old errors. I uninstalled 3.10 as 3.9 did not appear in control panel. Dell Inspiron 3793 Win 10 Thanks Dave Francis -- https://mail.python.org/mailman/listinfo/python-list

Re: help me in a program in python to implement Railway Reservation System using file handling technique.

2018-11-25 Thread francis
On Saturday, 24 November 2018 14:33:29 UTC+8, jasmin amrutia wrote: > hello all, > please hepl me in the above program. python to implement Railway Reservation > System using file handling technique. > > System should perform below operations. > a. Reserve a ticket for a passenger. > b. List in

2 Bugs: in Python 3 tutorial, and in bugs.python.org tracker registration system

2018-09-21 Thread Francis Esmonde-White
regards, Francis Esmonde-White ### *Bug 1:* In the Python 3 tutorial section 9.8 for iterators <https://docs.python.org/3/tutorial/classes.html#iterators>, the example code for the iterator class Reverse has the iterator self.index defined only in the __init__

Python on windows 10

2015-11-26 Thread francis funari
Thankyou Francis Funari Sent from Mail<http://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10 -- https://mail.python.org/mailman/listinfo/python-list

Re: python 2.7 and unicode (one more time)

2014-11-21 Thread Francis Moreau
On 11/20/2014 04:15 PM, Chris Angelico wrote: > On Fri, Nov 21, 2014 at 1:14 AM, Francis Moreau > wrote: >> Hi, >> >> Thanks for the "from __future__ import unicode_literals" trick, it makes >> that switch much less intrusive. >> >> However it

Re: python 2.7 and unicode (one more time)

2014-11-20 Thread Francis Moreau
Hi, On 11/20/2014 11:47 AM, Chris Angelico wrote: > On Thu, Nov 20, 2014 at 8:40 PM, Francis Moreau > wrote: >> My question is: how should this be fixed properly ? >> >> A simple solution would be to force all strings passed to the >> logger to be unico

python 2.7 and unicode (one more time)

2014-11-20 Thread Francis Moreau
Hello, My application is using gettext module to do the translation stuff. Translated messages are unicode on both python 2 and 3 (with python2.7 I had to explicitely asked for unicode). A problem arises when formatting those messages before logging them. For example: log.debug("%s: %s" % (hea

Help needed to create a Python extension library for an existing shared memory hash table library

2014-03-22 Thread Simon Hardy-Francis
Hi Python fans, I just released my first open source project ever called SharedHashFile [1]. It's a shared memory hash table written in C. Some guy on Quora asked [2] whether there's an extension library for Python coming out. I would like to do one but I know little about Python. I was wonderin

Re: Decoding a process output

2014-03-05 Thread Francis Moreau
On 03/04/2014 05:05 PM, Peter Otten wrote: > Francis Moreau wrote: > >> Hi, >> >> In my understanding (I'm relatively new to python), I need to decode any >> bytes data provided, in my case, by a shell command (such as findmnt) >> started by the subprocess

Decoding a process output

2014-03-04 Thread Francis Moreau
Hi, In my understanding (I'm relatively new to python), I need to decode any bytes data provided, in my case, by a shell command (such as findmnt) started by the subprocess module. The goal of my application is to parse the command outputs. My application runs only on linux BTW and should run fin

ANN: EmPy 3.3.2 released (Python 3.x compatibility)

2014-01-28 Thread Erik Max Francis
EmPy should work with any version of Python from 2.4 onward, including 3.x. License This code is released under the LGPL. Release history [since 3.3] - 3.3.2; 2014 Jan 24. Additional fix for source compatibility between 2.x and 3.0. - 3.3.1; 2014 Jan 22. Source c

Re: Python #ifdef

2013-06-02 Thread Erik Max Francis
hp files). But still, GNU M4 is a decent piece of technology. Agreed. The terror that most people feel when hearing "m4" is because m4 was associated with sendmail, not because m4 was inherently awful. It has problems, but you'd only encounter them when doing something _very_ abs

Building a HPC data assimilation system using Python?

2013-05-29 Thread Matthew Francis
I have a prototype data assimilation code ( an ionospheric nowcast/forecast model driven by GPS data ) that is written in IDL (interactive data language) which is a horrible language choice for scaling the application up to large datasets as IDL is serial and slow (interpreted). I am embarking

Re: Right way to initialize python embedded in a multi-threaded application

2013-05-11 Thread francis . brosnan
Just clarify there's no problem about calling twice to PyEval_InitThreads () as indicated by Python's doc. > Hi, > > > > Maybe you already fixed the issue, but for the record, I've got the same > > problem and finally it turned out that I was calling PyEval_InitThreads twice > > and also afte

Re: Right way to initialize python embedded in a multi-threaded application

2013-05-11 Thread francis . brosnan
Hi, Maybe you already fixed the issue, but for the record, I've got the same problem and finally it turned out that I was calling PyEval_InitThreads twice and also after fixing that, I also had to move the call to PyEval_ReleaseLock(); at the end of the entire initialization (not just after PyE

Re: Single leading dash in member variable names?

2012-09-11 Thread Erik Max Francis
as syntactic significance. Thank you! PEP 8 says this is bad form. What do you think? Where does it say that? -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Jabber erikmaxfrancis

Re: Encapsulation, inheritance and polymorphism

2012-07-21 Thread Erik Max Francis
On 07/20/2012 03:28 AM, BartC wrote: "Erik Max Francis" wrote in message news:gskdnwoqpkoovztnnz2dnuvz5s2dn...@giganews.com... On 07/20/2012 01:11 AM, Steven D'Aprano wrote: On Thu, 19 Jul 2012 13:50:36 -0500, Tim Chase wrote: I'm reminded of Graham's Number, whi

Re: Encapsulation, inheritance and polymorphism

2012-07-21 Thread Erik Max Francis
On 07/20/2012 02:05 AM, Virgil Stokes wrote: On 20-Jul-2012 10:27, Steven D'Aprano wrote: The fellow looked relived and said "Oh thank god, I thought you said *million*!" How does this relate to the python list? It's also a seriously old joke. -- Erik Max Francis

Re: Encapsulation, inheritance and polymorphism

2012-07-20 Thread Erik Max Francis
n Graham's Number but still inconceivably ginormous.) You don't even need to go that high. Even a run-of-the-mill googol (10^100) is far larger than the total number of elementary particles in the observable Universe. -- Erik Max Francis && m...@alcyone.com && http://w

Re: while True or while 1

2012-01-23 Thread Erik Max Francis
Giampaolo Rodolà wrote: Il 21 gennaio 2012 22:13, Erik Max Francis ha scritto: The real reason people still use the `while 1` construct, I would imagine, is just inertia or habit, rather than a conscious, defensive decision. If it's the latter, it's a case of being _way_ too defensi

Re: while True or while 1

2012-01-21 Thread Erik Max Francis
e idiomatic `while 1` notation comes from back in the pre-Boolean days. In any reasonably modern implementation, `while True` is more self-documenting. I would imagine the primary reason people still do it, any after-the-fact rationalizations aside, is simply habit. -- Erik Max Francis &&a

Re: while True or while 1

2012-01-21 Thread Erik Max Francis
e of being _way_ too defensive. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Jabber erikmaxfrancis Ambition can creep as well as soar. -- Edmund Burke -- http://mail.python.org/mailman/listinfo/python-list

Embedded python console and FILE* in python 3.2

2011-08-08 Thread Francis Labarre
Hello everyone, I'm currently trying to port some embedded code from python 2.7 to python 3.2. The current code replicate the basic behavior of the python interpreter in anMFC application. When a command is entered in our embedded interpreter, we write it to a FILE* then transform this FILE* int

Re: Is it bad practise to write __all__ like that

2011-07-28 Thread Erik Max Francis
f.append(obj.__name__) return obj __all__ = AllList() @__all__ def api(): pass @__all__ def db(): pass @__all__ def input(): pass @__all__ def output(): pass @__all__ def tcl(): pass Bravo! -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose,

Re: Significant figures calculation

2011-06-28 Thread Erik Max Francis
Mel wrote: Erik Max Francis wrote: Mel wrote: By convention, nobody ever talks about 1 x 9.97^6 . Not sure what the relevance is, since nobody had mentioned any such thing. If it was intended as a gag, I don't catch the reference. I get giddy once in a while.. push things to limits

Re: Significant figures calculation

2011-06-28 Thread Erik Max Francis
t 2 x 10^-8 kg, or on the order of 10^-8 kg (zero significant figures). To convert to energy, multiply by c^2. c = 3 x 10^8 m/s, so c^2 = 9 x 10^16 m^2/s^2, or about 10^17 m^2/s^2, so the Planck energy is on the order of 10^9 J. That's a calculation to zero significant figures. --

Re: Significant figures calculation

2011-06-28 Thread Erik Max Francis
Mel wrote: Erik Max Francis wrote: Chris Angelico wrote: On Tue, Jun 28, 2011 at 12:56 PM, Steven D'Aprano wrote: Zero sig figure: 0 That's not really zero significant figures; without further qualification, it's one. Is 0.0 one sig fig or two? Two. (Just vaguely curiou

Re: Significant figures calculation

2011-06-27 Thread Erik Max Francis
igure would be an order of magnitude estimate only. These aren't usually done in the "e" scientific notation, but it would be something like 10^3 (if we assume ^ is exponentiation, not the Python operator). c^2 is 9 x 10^16 m^2/s^2 to one significant figure. It's 10^17 m^2/

Re: Significant figures calculation

2011-06-27 Thread Erik Max Francis
ero sig figures value is ever useful.) Yes. They're order of magnitude estimates. 1 x 10^6 has one significant figure. 10^6 has zero. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y

Re: break in a module

2011-06-17 Thread Erik Max Francis
Steven D'Aprano wrote: On Thu, 16 Jun 2011 22:20:50 -0700, Erik Max Francis wrote: [...] Yes, which could be rephrased as the fact that `break` and `continue` are restricted to looping control structures, so reusing `break` in this context would be a bad idea. You know, kind of like the

Re: break in a module

2011-06-16 Thread Erik Max Francis
Ian Kelly wrote: On Thu, Jun 16, 2011 at 10:24 PM, Erik Max Francis wrote: True. So let's use `in` to represent breaking out of the top-level code of a module. Why not, it's not the first time a keyword has been reused, right? The point is, if it's not obvious already from

Re: break in a module

2011-06-16 Thread Erik Max Francis
Ian Kelly wrote: On Thu, Jun 16, 2011 at 7:21 PM, Erik Max Francis wrote: Neither makes sense. `break` exits out of looping structures, which the top-level code of a module most certainly is not. Why does that matter? It seems a bit like arguing that the `in` keyword can't be use

Re: break in a module

2011-06-16 Thread Erik Max Francis
t you're just being difficult. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis Winners are men who have dedicated their whole lives to winning. -- Woody Hayes -- http://mail.python.org/mailman/listinfo/python-list

Re: break in a module

2011-06-16 Thread Erik Max Francis
`. If you want to conditionally execute some code, use `if`. If you want to indicate an exceptional condition, raise an exception. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype eri

Re: break in a module

2011-06-16 Thread Erik Max Francis
Chris Angelico wrote: On Fri, Jun 17, 2011 at 9:29 AM, Erik Max Francis wrote: Chris Angelico wrote: On Fri, Jun 17, 2011 at 8:07 AM, Erik Max Francis wrote: It's quite consistent on which control structures you can break out of -- it's the looping ones. Plus functions. N

Re: break in a module

2011-06-16 Thread Erik Max Francis
Chris Angelico wrote: On Fri, Jun 17, 2011 at 8:07 AM, Erik Max Francis wrote: It's quite consistent on which control structures you can break out of -- it's the looping ones. Plus functions. No: >>> def f(): ... break ... File "", line 2 SyntaxError: 

Re: break in a module

2011-06-16 Thread Erik Max Francis
lookup where the keys are functions, and execute the value. Even then, unless there are quite a lot of cases, this may be overkill. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxf

Re: break in a module

2011-06-16 Thread Erik Max Francis
Eric Snow wrote: On Tue, Jun 14, 2011 at 5:51 PM, Erik Max Francis wrote: Ethan Furman wrote: To me, too -- too bad it doesn't work: c:\temp>\python32\python early_abort.py File "early_abort.py", line 7 return ^ SyntaxError: 'return' outside funct

Re: break in a module

2011-06-14 Thread Erik Max Francis
eak". To me, too -- too bad it doesn't work: c:\temp>\python32\python early_abort.py File "early_abort.py", line 7 return ^ SyntaxError: 'return' outside function Nor should it. There's nothing to return out of. -- Erik Max Francis && m.

Re: break in a module

2011-06-14 Thread Erik Max Francis
onsist of mostly definitions. Modules can interact with each other, be called recursively, etc., and so at an arbitrary point saying, "break out of this module" doesn't have a great deal of meaning. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis There is _never_ no hope left. Remember. -- Louis Wu -- http://mail.python.org/mailman/listinfo/python-list

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

2011-06-05 Thread Erik Max Francis
ite a different thing, not simply a Kronecker delta extended to the reals. Kronecker deltas are used all the time over the reals; for instance, in tensor calculus. Just because the return values are either 0 or 1 doesn't mean that their use is incompatible over reals (as integers

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

2011-05-28 Thread Erik Max Francis
he IEEE standard. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis There was never a good war or a bad peace. -- Benjamin Franklin, 1706-1790 -- http://mail.python.org/mailman/listinfo/python-list

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

2011-05-28 Thread Erik Max Francis
nan} {nan} It's fundamentally because NaN is not equal to itself, by design. Dictionaries and sets rely on equality to test for uniqueness of keys or elements. >>> nan = float("nan") >>> nan == nan False In short, don't do that. -- Erik Max Francis &&

Re: value of pi and 22/7

2011-03-17 Thread Erik Max Francis
quency. In all bases. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis They love too much that die for love. -- (an English proverb) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 90, Issue 48

2011-03-07 Thread francis gan
Hi, How do I make a downloaded file layerfx.py executable in Gimp? using the Python console. the layerfx.py is in the download folder thanks Francis On 3/8/11, python-list-requ...@python.org wrote: > Send Python-list mailing list submissions to > python-list@python.org > >

Re: "Strong typing vs. strong testing"

2010-10-12 Thread Erik Max Francis
ey'll work will help alone. If you're calling a trigonometric function with a dimensionless argument, you either mean radians are you've got bigger problems with the understanding of unit systems. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/

Re: "Strong typing vs. strong testing"

2010-09-28 Thread Erik Max Francis
Keith Thompson wrote: Erik Max Francis writes: [...] >>> print c # floating point accuracy aside 299792458.0 m/s Actually, the speed of light is exactly 299792458.0 m/s by definition. (The meter and the second are defined in terms of the same wavelength of light; this wa

Re: "Strong typing vs. strong testing"

2010-09-28 Thread Erik Max Francis
ror: and do not have compatible units And everybody's favorite: >>> print ((epsilon_0*mu_0)**-0.5).simplify() 299792458.011 m/s >>> print c # floating point accuracy aside 299792458.0 m/s -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis In Heaven all the interesting people are missing. -- Friedrich Nietzsche -- http://mail.python.org/mailman/listinfo/python-list

Re: Classes and threading

2010-05-18 Thread Erik Max Francis
t_ take any arguments, and explicitly call its parent constructor not passing anything. So it shouldn't be a wonder that it won't accept any arguments. If you don't intend to override the constructor in the parent class, simply don't define it. -- Erik Max Francis &&am

Re: Draft PEP on RSON configuration file format

2010-03-02 Thread Erik Max Francis
Patrick Maupin wrote: On Mar 2, 9:20 pm, Erik Max Francis wrote: Patrick Maupin wrote: On Mar 2, 5:36 pm, Steven D'Aprano wrote: You seem to be taking the position that if you start with a config file config.json, it is "too hard to edit", but then by renaming it to config.rs

Re: Draft PEP on RSON configuration file format

2010-03-02 Thread Erik Max Francis
#x27;s the argument being used against you, not the argument being ascribed to you. You're getting confused about something, somewhere. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype

Re: Draft PEP on RSON configuration file format

2010-03-01 Thread Erik Max Francis
make your own "more readable" format. If JSON is unreadable, so must be RSON. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis It's better to be quotab

Re: Draft PEP on RSON configuration file format

2010-03-01 Thread Erik Max Francis
point out that in their opinion it's not such a good idea. You don't own this or any other thread. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis It's better to be quotable than to be honest. -- Tom Stoppard -- http://mail.python.org/mailman/listinfo/python-list

Re: Draft PEP on RSON configuration file format

2010-03-01 Thread Erik Max Francis
not one of them. Agreed. Even YAML's acronym indicates that it is already a bridge too far; we don't need more. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmax

Re: Dreaming of new generation IDE

2010-02-11 Thread Francis Carr
> I can't believe the code editing situation today is in a such sorry > state. I can't believe an old coder is feeling so sorry for himself. > Today, I tried to understand the twisted.web.client code and I found 3 > methods I couldn't find by who were called. > > I asked on the mailing list and t

Re: syntax error : first python program

2009-12-22 Thread Erik Max Francis
pradeep wrote: I have this file in linux === sample.py #!/usr/bin/env python name = "blah" print name ... Any one knows , whats the syntax error here? You're indenting for no reason. -- Erik Max Francis && m...@alcyone.com && h

Re: python bijection

2009-12-03 Thread Francis Carr
[In re R. Hettinger's critiques] > * it extends the language with arcane syntax tricks... I think most of these in the current version of J. Bronson's "bidict" can be left unused, or removed altogether. In almost all cases, a bidict should be accessed as an ordinary python dict. > * we've alrea

Re: need clarification on -0

2009-11-30 Thread Erik Max Francis
ssions. See python.org/doc for more information. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis You'll survive / A true Darwin star -- Des'ree -- http://mail.python.org/mailman/listinfo/python-list

Re: python bijection

2009-11-27 Thread Francis Carr
I was really inspired by this discussion thread! :-) After much tinkering, I think I have a simpler solution. Just make the inverse mapping accessible via an attribute, -AND- bind the inverse of -THAT- mapping back to the original. The result is a python dict with NO NEW METHODS except this inve

Re: Python-URL! - weekly Python news and links (Nov 24)

2009-11-24 Thread Erik Max Francis
t the answer they're looking for. The former is surely just laziness, but there's something psychological going on with the latter. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-16 Thread Erik Max Francis
the same syntax, with `fi` written instead of `endif` -- not sure why the difference in keyword is that big of a deal to you. As others have pointed out, either way, there are quite a few languages that use this type of syntax. -- Erik Max Francis && m...@alcyone.com && http:/

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-16 Thread Erik Max Francis
was not a suggestion to change Python. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis Mona Lisa / Come to discover / I am your daughter -- Lamya -- http://mail.python.org/mailman/listinfo/python-list

Re: Most efficient way to "pre-grow" a list?

2009-11-11 Thread Francis Carr
Hmmm. I am trying some algorithms, and timeit reports that a list.extend variant is fastest... WTH?! Really this seems like it must be a "bug" in implementing the "[None]*x" idiom. As expected, appending one-at-a-time is slowest (by an order of magnitude): % python -m timeit -s "N=100" \

Re: Is there a command that returns the number of substrings in a string?

2009-10-23 Thread Erik Max Francis
ng. I'm wondering if there is a function in python which can directly return this information. The .count string method. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis

Re: (from stdlib-sig) ctypes or struct from an h file

2009-10-19 Thread Erik Max Francis
on defined and need not be supported by any compilers. The proper way to do this is to define a protocol and translate it to the native structures on both sides of the communication -- both in Python and in C. There's really no way around this. -- Erik Max Francis && m

Re: (from stdlib-sig) ctypes or struct from an h file

2009-10-18 Thread Erik Max Francis
these things will be the same. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis Diplomacy and defense are not substitutes for one another. Either alone would fail. -

Re: id( ) function question

2009-10-16 Thread Erik Max Francis
of and would have no obligation to switch to, just as with 3.0. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis Nothing spoils a confession like repentence. -- Anatole France -- http://mail.python.org/mailman/listinfo/python-list

Re: id( ) function question

2009-10-15 Thread Erik Max Francis
x27;re the same object is pretty much never useful. The other canonical use of `is` would be comparison to `None`, which is also perfectly appropriate. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && A

Re: id( ) function question

2009-10-14 Thread Erik Max Francis
what the value of `id` is or how the `is` operator works, the short version is, don't worry about them, as you won't be using them. I'm really rather surprised at the number of questions about them. They're really something one does not need to worry about. -- Erik Max Fr

Re: a=[1,2,3,4].reverse() - why "a" is None?

2009-10-12 Thread Erik Max Francis
Andre Engels wrote: The reverse function is a function to reverse the list in place, not a function to get the reverse of the list: x = [1,2,3,4] y = x z = x.reverse() will result in: x = y = [4,3,2,1] z = None .reverse returns None. See the documentation. -- Erik Max Francis &

Re: Why ELIF?

2009-10-11 Thread Erik Max Francis
xpressions. Variations of `else if` in `if ... else if ...` chains is routine in computer languages. Choosing a deliberately different syntax just for the sake it of is obtuse at best. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA &

Re: question about the GC implementation

2009-10-05 Thread Francis Moreau
On Oct 3, 11:58 pm, ryles wrote: > >     Only objects with GC_TENTATIVELY_UNREACHABLE still set are > candidates for collection.  If it's decided not to collect such an object > (e.g., it has a __del__ method), its gc_refs is restored to GC_REACHABLE > again. Ok so it happens _only_ w

question about the GC implementation

2009-10-02 Thread Francis Moreau
Hello, I'm looking at gcmodule.c and in move_unreachable() function, the code assumes that if an object has its gc.gc_refs stuff to 0 then it *may* be unreachable. How can an object tagged as unreachable could suddenly become reachable later ? Thanks -- http://mail.python.org/mailman/listinfo/p

Re: Doubley imported module caused devastating bug

2009-09-27 Thread Francis Carr
> I would like to propose that it be made impossible in the Python > source to import two instances of the same module. A fully-automatic solution is more difficult than it might seem at first: http://www.python.org/dev/peps/pep-0328/ But there is a simple code-discipline solution: never ever us

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-26 Thread Erik Max Francis
ant to talk about it you have to disclaim that it's not a proper base and that's you're making up as you go. But you can't pretend like it's the "obvious" mathematical meaning just because the usual mathematical meaning doesn't apply, which is what you see

Re: Temat:,Re: IOError: [Errno 22] invalid mode ('wb') or filename: in windows xp while making tarfile

2009-08-24 Thread Erik Max Francis
lt with it. Had to change 'w:bz2' into 'w|bz2'. But now have another problem: It's the same problem, asked and answered. Why not read the replies of the people telling you what the problem is? -- Erik Max Francis && m...@alcyone.com && http://www.alcyon

Re: Annoying octal notation

2009-08-24 Thread Erik Max Francis
gure. 9 is not the same as 9.0 or 9.000. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis If the sky should fall, hold up your hands. -- (a Spanish proverb) -- http://mail.python.org/mailman/listinfo/python-list

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread Erik Max Francis
Hendrik van Rooyen wrote: I also tried to include an example of a literal with a base of a Googol but I ran out of both ink and symbols. :-) ... or particles in the observable Universe, for that matter. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ S

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread Erik Max Francis
hard to imagine). Either way, conversion is, as Max showed, one line of code. It's hard to see the explicit need for truly arbitrary-radix literals in any language -- and I'm the guy who's put quaternary literals in syntaxes he's had to develop just for fun. Binary

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread Erik Max Francis
James Harris wrote: On 24 Aug, 09:05, Erik Max Francis wrote: Here's another suggested number literal format. First, keep the familar 0x and 0b of C and others and to add 0t for octal. (T is the third letter of octal as X is the third letter of hex.) The numbers above would be 0b1011, 0

Re: Literal concatenation, strings vs. numbers

2009-08-24 Thread Erik Max Francis
ne so upset by this that it didn't make it into the language, or cause huge confusion on a regular basis that upsets a lot of users? Nope. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W &&

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread Erik Max Francis
with decimal 304? You can't, and the operation makes no sense, which is what makes the syntax unambiguous. An extended numeric literal continues the radix of wherever it started. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA &a

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread Erik Max Francis
large literals, I'd go with having spaces indicate automatic concatenation (though only the first in the series can indicate the radix, whichever method you choose above). It's the same as for strings, and it's the common SI recommendation for thousands separators anyway. -- Erik Ma

Re: IOError: [Errno 22] invalid mode ('wb') or filename: in windows xp while making tarfile

2009-08-23 Thread Erik Max Francis
trings), too, or that's going to bite you sometime later (but it's not your main problem here). -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis Every human being is a problem in search of a solution. -- Ashley Montague -- http://mail.python.org/mailman/listinfo/python-list

Re: OT Signature quote [was Re: Unrecognized escape sequences in string literals]

2009-08-16 Thread Erik Max Francis
Douglas Alan wrote: Personally, my favorite is Lisp, which looks like (set! y (+ y 1)) For varying values of "Lisp." `set!` is Scheme. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W &&

Re: OT Signature quote [was Re: Unrecognized escape sequences in string literals]

2009-08-16 Thread Erik Max Francis
nt. Given the history of programming languages, it doesn't really look like the to-be-assigned variable being at the end of expression is going to get much play, since not a single major one I'm familiar with does it that way, and a lot of them have come up with the same convention

Re: OT Signature quote [was Re: Unrecognized escape sequences in string literals]

2009-08-14 Thread Erik Max Francis
Grant Edwards wrote: On 2009-08-14, Erik Max Francis wrote: Grant Edwards wrote: On 2009-08-14, Steven D'Aprano wrote: What the hell would it actually do??? IIRC in C++, cout << "Hello world"; is equivalent to this in C: printf("Hellow world")

Re: OT Signature quote [was Re: Unrecognized escape sequences in string literals]

2009-08-14 Thread Erik Max Francis
ell, plus or minus newlines. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis It's hard to say what I want my legacy to be when I'm long gone. -- Aaliyah -- http://mail.python.org/mailman/listinfo/python-list

Unsigned char array to an unsigned longlong array

2009-08-13 Thread Francis Brissette
ercise for the double array, the hex form will look like: [0807060504030201]. And the decimal value would be: [5.784376957523072e+17]. Where does the 5.447603722011605e-270 value comes from ? Thanks for your help, Francis -- http://mail.python.org/mailman/listinfo/python-list

Re: len() should always return something

2009-07-26 Thread Erik Max Francis
eparate entity. Especially if you're dealing with a special-purpose language where everything is really a form of an generalized array representation of something _anyway_. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA &&

Re: len() should always return something

2009-07-25 Thread Erik Max Francis
Chris Rebert wrote: On Sat, Jul 25, 2009 at 4:21 PM, Erik Max Francis wrote: Steven D'Aprano wrote: But it's not "practically every function". It's hardly any function at all -- in my code, I don't think I've ever wanted this behavior. I would consider it an

Re: len() should always return something

2009-07-25 Thread Erik Max Francis
there are numerous applications where scalars and 1x1 matrices are mathematically equivalent. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis Gods are born and die, but

Einstein summation notation (was: question of style)

2009-07-16 Thread Erik Max Francis
sy ways to verify you have a valid tensor equation using it. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis If the sky should fall, hold up your hands. -- (a Spanish

Re: question of style

2009-07-02 Thread Erik Max Francis
ngely turned inside out. You're obviously looking for which one _isn't_ `None`, so write the tests that way. It's much easier for everyone else (including your potential future self) to follow. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/m

Re: itertools.intersect?

2009-06-22 Thread Francis Carr
On Jun 11, 6:23 pm, Mensanator wrote: > Removing the duplicates could be a big problem. It is fairly easy to ignore duplicates in a sorted list: from itertools import groupby def unique(ordered): """Yield the unique elements from a sorted iterable. """ for key,_ in groupby(ordered):

Re: 4 hundred quadrillonth?

2009-05-24 Thread Erik Max Francis
c. Even if you restrict yourself to base-b expansions (for which the statement is true for integer bases), you can cheat there too: e is 1 in base e. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W &&a

Re: 4 hundred quadrillonth?

2009-05-24 Thread Erik Max Francis
erics Manual, 2nd Edition, published in 1988? It's such a classic piece that I think it should be posted somewhere... I only see used versions of it available for purchase. Care to hum a few bars? -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose,

  1   2   3   4   5   6   7   >