Re: Python becoming less Lisp-like

2005-03-21 Thread Jeff Shannon
Antoon Pardon wrote: Op 2005-03-18, Jeff Shannon schreef [EMAIL PROTECTED]: I find it odd that you start by saying you still find them very consistent and here state there is a slight inconsistency. I said that the way that binding a name on a class instance always creates an instance attribute

Re: getting text from WinXP console

2005-03-21 Thread Jeff Shannon
app's output (and probably perform the actual display on-screen). This won't let you capture the text of an arbitrary window, though, and would probably be pretty fragile. Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: For loop extended syntax

2005-03-21 Thread Jeff Shannon
straightforward as is being claimed. There may be valid arguments in favor of enhancing tuple unpacking in this way (indeed, I believe I recall a thread or two on this subject), but it's important to consider the general consequences, not just the single aspect of for-loop usage. Jeff Shannon -- http

Re: getting text from WinXP console

2005-03-21 Thread Jeff Shannon
Peter Hansen wrote: Jeff Shannon wrote: Unless I'm seriously mistaken, the only way that this will be possible is if there's a Win32 API call that will give the correct information. This might be possible to find in the MSDN documentation, if it exists, but I suspect that it probably doesn't

Re: Python becoming less Lisp-like

2005-03-18 Thread Jeff Shannon
Antoon Pardon wrote: Op 2005-03-16, Jeff Shannon schreef [EMAIL PROTECTED]: Bruno Desthuilliers wrote: - if x is a class attribute of class A and a is an instance of A, a.x=anyvalue create a new instance attribute x instead of modifying A.x This is very consistent with the way that binding a name

Re: how to handle repetitive regexp match checks

2005-03-18 Thread Jeff Shannon
is that the else clause only runs if the for loop terminates normally -- if you break out of the loop, the else does *not* run. Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python like VB?

2005-03-18 Thread Jeff Shannon
not too surprising that OpenOffice hasn't changed that much. Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Jeff Shannon
Raymond Hettinger wrote: def count(self, value, qty=1): try: self[key] += qty except KeyError: self[key] = qty I presume that the argument list is a typo, and should actually be def count(self, key, qty=1): ... Correct? Jeff

Re: Getting current variable name

2005-03-17 Thread Jeff Shannon
() doesn't try to do that... Don't forget, in Python, all names are references. You only have to be careful when you start re-binding names... Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: will it cause any problems to open a read-only file not close it?

2005-03-16 Thread Jeff Shannon
as part of the object deletion, files opened in this way won't be closed until the garbage collector runs (and collects this file object). Most of the time, this won't be a problem, but it's good to be aware that things are not necessarily as cut-and-dried as they might seem. Jeff Shannon -- http

Re: multiple import of a load of variables

2005-03-16 Thread Jeff Shannon
the whole mess as one big file, because you're throwing away almost all of the benefits of dividing it into modules. Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 18, Issue 208

2005-03-15 Thread Jeff Shannon
Martin v. Löwis wrote: Jeff Shannon wrote: I'd be in favor of that, unless someone can come up with a compelling current use-case for octal literals. Existing code. It may use octal numbers, and it would break if they suddenly changed to decimal. Right, which was my original point

Re: Python becoming less Lisp-like

2005-03-15 Thread Jeff Shannon
towards the hight end of that range. Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: Python becoming less Lisp-like

2005-03-15 Thread Jeff Shannon
that Python's design choices will decrease the frequency of bugs. Perhaps Python *is* becoming less Lisp-like... but I've never been convinced that Lisp is the best of all possible programming languages, so maybe being less Lisp-like and more Python-like is a good thing. Jeff Shannon -- http

Re: Python-list Digest, Vol 18, Issue 208

2005-03-14 Thread Jeff Shannon
about for backwards compatibility. Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 18, Issue 208

2005-03-14 Thread Jeff Shannon
Steven Bethard wrote: Jeff Shannon wrote: now that almost the entire industry has standardized on power-of-2 word sizes, octal is nearly useless but is still carried about for backwards compatibility. So do you think it's worth lobbying for its removal in Python 3.0 when we can break some

Re: will it cause any problems to open a read-only file not close it?

2005-03-14 Thread Jeff Shannon
. Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib (and urllib2) read all data from page on open()?

2005-03-14 Thread Jeff Shannon
instead of the application code.) If you need to care about when the network access happens, then you should be using the lower-level protocols -- httplib and/or socket. Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: a program to delete duplicate files

2005-03-14 Thread Jeff Shannon
it worthwhile to invest a *large* number of petaflops of processing power.) Sure it's not 100% perfect, but... how perfect do you *really* need? Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I load a module when I will only know the name 'on the fly'

2005-03-14 Thread Jeff Shannon
Tobiah wrote: m = get_next_module() some_nice_function_somehow_loads( m ) that'd be mymodule = __import__('modulename') Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: global var

2005-02-21 Thread Jeff Shannon
in the execution of global var. Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Jeff Shannon
that it means what you think it means. Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: Pausing a program - poll/sleep/threads?

2005-02-17 Thread Jeff Shannon
periodically every second or so, rather than only after several minutes.) Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: [newbie]How to install python under DOS and is there any Wxpython can be installed under dos?

2005-02-17 Thread Jeff Shannon
. There *are* similar-but-not-compatible libraries for DOS... or perhaps I should say *were*, because I have no idea where one might find such a thing now. (Though I presume that Google would be the best starting place.) One would then need to find/create a Python wrapper for that library... Jeff Shannon

Re: Pausing a program - poll/sleep/threads?

2005-02-17 Thread Jeff Shannon
your client taking direct action. I really think that you *do* want to do fairly frequent status checks with your server. The cost is small, and the gains in responsiveness and robustness are potentially very significant. Jeff Shannon -- http://mail.python.org/mailman/listinfo/python-list

Re: super not working in __del__ ?

2005-02-17 Thread Jeff Shannon
Christopher J. Bottaro wrote: Jeff Shannon wrote: Python's __del__() is not a C++/Java destructor. Learn something new everyday... What is it then? Excuse my ignorance, but what are you suppose to do if your object needs to clean up when its no longer used (like close open file handles, etc

Re: super not working in __del__ ?

2005-02-16 Thread Jeff Shannon
(normally) be cleaned up while they're still in use, but during program shutdown refcounting necessarily ceases to apply. The closest that would happen in C++, I believe, would manifest itself as memory leaks and/or access of already-freed memory. Jeff Shannon Technician/Programmer Credit International

Re: [newbie]How to install python under DOS and is there any Wxpython can be installed under dos?

2005-02-16 Thread Jeff Shannon
obsolete for a decade or more. ;) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: renaming 'references' to functions can give recursive problems

2005-02-16 Thread Jeff Shannon
to this new function, it's simply calling itself. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't join() call str() on its arguments?

2005-02-16 Thread Jeff Shannon
that unicode.join() used unicode() and str.join() used str(), but I can conceive of the possibility of wanting to use a plain-string separator to join a list that might include unicode strings. Whether this is a realistic use-case is, of course, a completely different question... Jeff Shannon

Re: Imported or executed?

2005-02-16 Thread Jeff Shannon
-line checking than this...) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: super not working in __del__ ?

2005-02-16 Thread Jeff Shannon
to give an overal benefit. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Font size

2005-02-16 Thread Jeff Shannon
(recently mentioned here; google should help you find it) may meet your needs and be simpler to use. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't join() call str() on its arguments?

2005-02-16 Thread Jeff Shannon
() implementation that would be smart enough to do the right thing in this case, but it's not as simple as just implicitly calling str(). Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Variables.

2005-02-15 Thread Jeff Shannon
perfectly to me, so the issue is in what's expected. :) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-15 Thread Jeff Shannon
is irrelevant. Logic is irrelevant. You will be assimilated. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling a function from module question.

2005-02-15 Thread Jeff Shannon
as the harm of using it?) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Variables.

2005-02-15 Thread Jeff Shannon
Bruno Desthuilliers wrote: Jeff Shannon a écrit : If running a console app from Explorer, the console will close as soon as the app terminates. Using raw_input() at the end of the app means that it won't close until the user hits Enter. So why dont you just open the console before running

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-14 Thread Jeff Shannon
done half my work for me -- great!, he's saying Hey, why haven't you done the rest of my work! Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question

2005-02-11 Thread Jeff Shannon
Dennis Lee Bieber wrote: On Thu, 10 Feb 2005 09:36:42 -0800, Jeff Shannon [EMAIL PROTECTED] declaimed the following in comp.lang.python: And as Peter Hansen points out, none of the Python versions leave n in the same state that the C loop does, so that's one more way in which an exact

Re: goto, cls, wait commands

2005-02-11 Thread Jeff Shannon
like GOTO. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question

2005-02-10 Thread Jeff Shannon
Dennis Lee Bieber wrote: On Wed, 09 Feb 2005 18:10:40 -0800, Jeff Shannon [EMAIL PROTECTED] declaimed the following in comp.lang.python: for i in range(n)[::-1]: func(n) Shouldn't that be func(i) (the loop index?) You're right, that's what I *meant* to say. (What

Re: how can I replace a execfile with __import__ in class to use self variables

2005-02-10 Thread Jeff Shannon
(self): print self.var --- (Though frankly I don't see the advantage of having this tiny function in a separate file to begin with...) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: [N00B] What's %?

2005-02-10 Thread Jeff Shannon
for all sorts of periodic behavior. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: interactive execution

2005-02-09 Thread Jeff Shannon
-- there's no sandboxing involved, and the exec'ed string *can* use that __builtins__ reference (among other things) to do all sorts of malicious stuff.) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question

2005-02-09 Thread Jeff Shannon
may (as just one of many examples) be much better off with something more like: for i in range(n)[::-1]: func(n) The '[::-1]' iterates over the range in a reverse (decreasing) direction; this may or may not be necessary depending on the circumstances. Jeff Shannon Technician/Programmer

Re: Is Python as capable as Perl for sysadmin work?

2005-02-09 Thread Jeff Shannon
Courageous wrote: *checks self to see if self is wearing rose colored glasses* assert(self.glasses.color != 'rose') ;) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: variable declaration

2005-02-08 Thread Jeff Shannon
. After it, on step (3) you can safely and peacefully add new PowerOfGenerator variable. You can also get all places where said variable exists by using grep, or your editor's search feature. I don't see how a var declaration gains you anything over 'grep PowerOfGenerator *.py' ... Jeff Shannon

Re: Basic file operation questions

2005-02-08 Thread Jeff Shannon
during program shutdown if it hasn't happened before then. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Big development in the GUI realm

2005-02-08 Thread Jeff Shannon
medium would be a tricky edge case. I suspect it *could* be done in a GPL-acceptable way, but one would need to take care about it.) Of course, this is only my own personal interpretation and opinion -- IANAL, TINLA, YMMV, etc, etc. Jeff Shannon Technician/Programmer Credit International -- http

Re: interactive execution

2005-02-08 Thread Jeff Shannon
memory and is untested.) The net effect is that exec uses the subsequent dictionaries as its globals and locals, reading from and writing to them as necessary. (Note that this doesn't get you any real security, because malicious code can still get to __builtins__ from almost any object...) Jeff

Re: returning True, False or None

2005-02-04 Thread Jeff Shannon
Jeremy Bowers wrote: On Fri, 04 Feb 2005 16:44:48 -0500, Daniel Bickett wrote: [ False , False , True , None ] False would be returned upon inspection of the first index, even though True was in fact in the list. The same is true of the code of Jeremy Bowers, Steve Juranich, and Jeff Shannon

Re: changing local namespace of a function

2005-02-04 Thread Jeff Shannon
dictionaries that'll be passed into functions, create class instances. class MyClass(object): def __init__(self, **kwargs): for key, val in kwargs: setattr(self, key, val) def fun(self): self.z = self.y + self.x a = MyClass(x=1, y=2) a.fun() print a.z Jeff Shannon

Re: [noob] Error!

2005-02-04 Thread Jeff Shannon
with things. You've got a lot of subexpressions there; pick some values and try each subexpression, one at a time, and take a look at what you get. I bet that it won't take you long to figure out why you're not getting the result you expect. Jeff Shannon Technician/Programmer Credit

Re: Basic file operation questions

2005-02-03 Thread Jeff Shannon
in the vast majority of cases, but I'm naturally curious :) Disk access should be buffered, possibly both at the C-runtime level and at the file-iterator level (though I couldn't swear to that). I'm sure that the C-level buffering happens, though. Jeff Shannon Technician/Programmer Credit International

Re: python without OO

2005-01-27 Thread Jeff Shannon
essence of object-oriented programming. (What you describe here *is* object-oriented programming, you're just trying to avoid the 'class' statement and use module-objects where 'traditional' OO would use class instances.) Jeff Shannon Technician/Programmer Credit International -- http

Re: how to comment out a block of code

2005-01-27 Thread Jeff Shannon
on the computer case just for this! Normally it's a large round button, with perhaps a green backlight. Press the button and hold it in for about 3 seconds, and the rest of your code/writing will be ignored just as it should be. Jeff Shannon Technician/Programmer Credit International -- http

Re: subprocess.Popen() redirecting to TKinter or WXPython textwidget???

2005-01-27 Thread Jeff Shannon
are threadsafe, so you need to make all GUI calls from a single thread. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: String Fomat Conversion

2005-01-27 Thread Jeff Shannon
of buffering. The next question is, which provides the most *conceptual* simplicity? (The answer to that one, I think, depends on how your brain happens to see things...) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: inherit without calling parent class constructor?

2005-01-27 Thread Jeff Shannon
Christian Dieterich wrote: On Dé Céadaoin, Ean 26, 2005, at 17:09 America/Chicago, Jeff Shannon wrote: You could try making D a container for B instead of a subclass: Thank you for the solution. I'll need to have a closer look at it. However it seems like the decision whether to do some

Re: inherit without calling parent class constructor?

2005-01-27 Thread Jeff Shannon
Christian Dieterich wrote: On Déardaoin, Ean 27, 2005, at 14:05 America/Chicago, Jeff Shannon wrote: the descriptor approach does. In either case, the calculation happens as soon as someone requests D.size ... Agreed. The calculation happens as soon as someone requests D.size. So far so good

Re: Question about 'None'

2005-01-27 Thread Jeff Shannon
flamesrock wrote: I should also mention that I'm using version 2.0.1 (schools retro solaris machines :( ) At home (version 2.3.4) it prints out 'True' for the above code block. That would explain it -- as /F mentioned previously, the special case for None was added in 2.1. Jeff Shannon

Re: Browsing text ; Python the right tool?

2005-01-26 Thread Jeff Shannon
John Machin wrote: Jeff Shannon wrote: [...] If each record is CRLF terminated, then you can get one record at a time simply by iterating over the file (for line in open('myfile.dat'): ...). You can have a dictionary classes or factory functions, one for each record type, keyed off of the 2

Re: inherit without calling parent class constructor?

2005-01-26 Thread Jeff Shannon
give D's __init__() a B parameter that defaults to None. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Browsing text ; Python the right tool?

2005-01-26 Thread Jeff Shannon
John Machin wrote: Jeff Shannon wrote: [...] For ~10 or fewer types whose spec doesn't change, hand-coding the conversion would probably be quicker and/or more straightforward than writing a spec-parser as you suggest. I didn't suggest writing a spec-parser. No (mechanical) parsing is involved

Re: Classical FP problem in python : Hamming problem

2005-01-25 Thread Jeff Shannon
the identifiers made it so that you felt the need to add a comment indicating what they were identifying, I'd say that yes, the long words *are* helpful. ;) Comments are good, but self-documenting code is even better. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org

Re: Tuple slices

2005-01-25 Thread Jeff Shannon
? Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Another scripting language implemented into Python itself?

2005-01-25 Thread Jeff Shannon
(and probably quite desirable) approach. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Browsing text ; Python the right tool?

2005-01-25 Thread Jeff Shannon
Constructor, or maybe PythonCard, as examples) you'd be able to get very nice results. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Help! Host is reluctant to install Python

2005-01-25 Thread Jeff Shannon
... Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: python without OO

2005-01-25 Thread Jeff Shannon
like -- behavior is more important than declared type, so there's no value to having a huge assortment of potential types. Deep inheritance trees only happen when people are migrating from Java. ;) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo

Re: python without OO

2005-01-25 Thread Jeff Shannon
of approaching the same problem. That's *why* we have so many different programming languages -- because no single approach is the best one for all problems, and knowing multiple approaches helps you to use your favored approach more effectively. Jeff Shannon Technician/Programmer Credit

Re: Another scripting language implemented into Python itself?

2005-01-24 Thread Jeff Shannon
security issues I mentioned for Python. Unless you really need that level of features, you may be better off designing your own limited language. Check into the docs for pyparsing for a starter... Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman

Re: is this use of lists normal?

2005-01-24 Thread Jeff Shannon
your problem is to use one piece of information to retrieve another piece (or set) of information, dictionaries are very likely to be the best approach. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: why am I getting a segmentation fault?

2005-01-21 Thread Jeff Shannon
(and readable) fashion. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: default value in a list

2005-01-21 Thread Jeff Shannon
almost certainly some logical connection between the fields of the line you're splitting and keeping them as a class demonstrates that connection, but it still seems a bit smelly to me. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Zen of Python

2005-01-19 Thread Jeff Shannon
to be and no more, it's ... as nested as you have to be and no more, but if you need significant nesting, you might want to re-examine your design. ;) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: macros

2005-01-18 Thread Jeff Shannon
more succinctly ;) there's a big difference between having no practical way to prevent something, and actually encouraging it. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Assigning to self

2005-01-18 Thread Jeff Shannon
will be created and/or retrieved, and it also makes it trivial to replace the Singleton with some other pattern (such as, e.g., a Flyweight or Borg object) should the need to refactor arise. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo

Re: Statement local namespaces summary (was Re: python3: 'where' keyword)

2005-01-13 Thread Jeff Shannon
really not seeing what the gain is... (Then again, I haven't been following the whole using/where thread, because I don't have that much free time and the initial postings failed to convince me that there was any real point...) Jeff Shannon Technician/Programmer Credit International

Re: reference or pointer to some object?

2005-01-13 Thread Jeff Shannon
Antoon Pardon wrote: Op 2005-01-12, Jeff Shannon schreef [EMAIL PROTECTED]: It's also rather less necessary to use references in Python than it is in C et. al. You use nothing but references in Python, that is the reason why if you assign a mutable to a new name and modify the object through

Re: Refactoring; arbitrary expression in lists

2005-01-13 Thread Jeff Shannon
are unordered, the ordering of the literal (or of a set of statements adding to the dict) doesn't matter. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: What strategy for random accession of records in massive FASTA file?

2005-01-13 Thread Jeff Shannon
. And besides, for long-term archiving purposes, I'd expect that zip et al on a character-stream would provide significantly better compression than a 4:1 packed format, and that zipping the packed format wouldn't be all that much more efficient than zipping the character stream. Jeff Shannon

Re: reference or pointer to some object?

2005-01-13 Thread Jeff Shannon
parameters because *any* of those parameters might change. By simply returning (new) objects for all changes, the function makes it very clear what's affected and what isn't. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: What strategy for random accession of records in massive FASTA file?

2005-01-13 Thread Jeff Shannon
as well as DNA sequences, you've got at least a fifth base to represent, which means you need at least three bits per base, which means only two bases per byte (or else base-encodings split across byte-boundaries) That gets ugly real fast.) Jeff Shannon Technician/Programmer Credit

Re: a new Perl/Python a day

2005-01-12 Thread Jeff Shannon
Jon Perez wrote: ... or why 'Perl monkey' is an oft-heard term whereas 'Python monkey' just doesn't seem to be appropriate? That's just because pythons are more likely to *eat* a monkey than to be one :) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org

Re: Refactoring; arbitrary expression in lists

2005-01-12 Thread Jeff Shannon
an extra entry into the dict to map '.cc' to the same string as '.cpp'. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Securing a future for anonymous functions in Python

2005-01-12 Thread Jeff Shannon
/lambda than it is to a list comprehension. In this case, at least the code block is visually self-contained in a way that lambdas are not, but I still have to do more mental work to visualize the overall results than I need with list comps. Jeff Shannon Technician/Programmer Credit International

Re: reference or pointer to some object?

2005-01-12 Thread Jeff Shannon
to indicate error status. Changing the value of a parameter is a side-effect that complicates reading and debugging code, so Python provides (and encourages) more straightforward ways of doing things. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo

Re: Securing a future for anonymous functions in Python

2005-01-11 Thread Jeff Shannon
if not impossible, or they're simple and numerous (e.g. calling a function with different parameters) such that it's easy to write a factory function that returns closures rather than feed the parameter in with a lambda. Jeff Shannon Technician/Programmer Credit International -- http

Re: python3: 'where' keyword

2005-01-11 Thread Jeff Shannon
to write Visual Basic as filtered through Java and Perl... If I want mental gymnastics when reading code, I'd use Lisp (or Forth). (These are both great languages, and mental gymnastics would probably do me good, but I wouldn't want it as part of my day-to-day requirements...) Jeff Shannon

Re: reference or pointer to some object?

2005-01-11 Thread Jeff Shannon
to by somedict is garbage-collected, while the object pointed to by d has never changed. So, to do what you want to do, you simply need to arrange things so that your parameter is an object that can be mutated in-place. Jeff Shannon Technician/Programmer Credit International -- http

Re: python guy ide

2005-01-11 Thread Jeff Shannon
, save, alt-tab to command shell, uparrow-enter to run program... not as convenient as a toolbar button or hotkey, but it works. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Securing a future for anonymous functions in Python

2005-01-10 Thread Jeff Shannon
and difficult to sort out. But when list comps were introduced, after reading just a sentence or two on how they worked, they were completely clear and understandable -- much more so than map/lambda after many months of exposure. Jeff Shannon Technician/Programmer Credit International -- http

Re: The Industry choice

2005-01-07 Thread Jeff Shannon
Paul Rubin wrote: Jeff Shannon [EMAIL PROTECTED] writes: Note that the so-called 'viral' nature of GPL code only applies to *modifications you make* to the GPL software. Well, only under an unusually broad notion of modification. True enough. It can be difficult, in software development

Re: The Industry choice

2005-01-07 Thread Jeff Shannon
does *not* require that your code also be (L)GPL'ed. Changes to the core library must still be released under (L)GPL, but application code which merely *uses* the library does not. (I've forgotten, now, exactly how LGPL defines this distinction...) Jeff Shannon Technician/Programmer Credit

Re: The Industry choice

2005-01-07 Thread Jeff Shannon
Alex Martelli wrote: Jeff Shannon [EMAIL PROTECTED] wrote: Note that the so-called 'viral' nature of GPL code only applies to *modifications you make* to the GPL software. The *only* way in which your code can be 'infected' by the GPL is if you copy GPL source. ... (Problems may come

Re: Calling Function Without Parentheses!

2005-01-07 Thread Jeff Shannon
or not. Better to have that done by a developer tool (pychecker) than through runtime checks every time the program is used. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: sorting on keys in a list of dicts

2005-01-07 Thread Jeff Shannon
Nick Coghlan wrote: Jeff Shannon wrote: I suppose that your version has the virtue that, if the sortkey value is equal, items retain the order that they were in the original list, whereas my version will sort them into an essentially arbitrary order. Is there anything else that I'm missing

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Jeff Shannon
due respect to Richard Feynman, I'd have thought that counting numbers would be non-negative integers, rather than the full set of integers... which, I suppose, just goes to show how perilous it can be to make up new, more natural terms for things. ;) Jeff Shannon Technician/Programmer Credit

  1   2   >