Re: Python and SOAP status

2008-05-02 Thread Jeff
Twisted has SOAP support. -- http://mail.python.org/mailman/listinfo/python-list

Re: list.index crashes when the element is not found

2008-05-02 Thread Jeff
The generally used idiom for that is: lst = ['a', 'b', 'c'] if 'a' in lst: foo = lst.index('a') -- http://mail.python.org/mailman/listinfo/python-list

Re: Do you know of a much simpler way of writing a program that writes a program?

2008-05-02 Thread Jeff
Use lisp? -- http://mail.python.org/mailman/listinfo/python-list

Re: use php in python httpservers

2008-05-05 Thread Jeff
ctypes? -- http://mail.python.org/mailman/listinfo/python-list

Re: How to stop iteration with __iter__() ?

2008-08-19 Thread Jeff
On Aug 19, 7:39 am, ssecorp <[EMAIL PROTECTED]> wrote: > I want a parse a file of the format: > movieId > customerid, grade, date > customerid, grade, date > customerid, grade, date > etc. > > so I could do with open file as reviews and then for line in reviews. > > but first I want to take out the

Re: use of Queue

2008-08-27 Thread Jeff
> Your solution works assuming that you know how many consumer threads > you have :). I don't :). More than that, it's not correct if you have > more than one producer :). Having a sentinel was my very first idea, > but as you see... it's a race condition (there are cases in which not > all items a

Re: Understanding this generator function

2008-08-27 Thread Jeff
> def counter(start_at=0): >     count = start_at >     while True: >         val = (yield count) A generator can accept a value from the consumer. So, If I have a counter: c = counter() I can send it a value: c.send(9) >         if val is not None: >             count = val The generato

Re: Job queue using xmlrpc and threading

2008-09-22 Thread Jeff
Try using the Queue module - http://docs.python.org/lib/module-Queue.html. Here is a tutorial with it - http://www.artfulcode.net/articles/multi-threading-python/. -- http://mail.python.org/mailman/listinfo/python-list

Re: Content Management System

2006-03-29 Thread Jeff
orry about. > > Me: OK. So, then what's a file system? > > Myself: That's not web-based. File-Systems are desktop-based. Everything is file based, even database tables. HTH, Cheers, Jeff > > Me: You can have a file-system on a common network server. I can even

Training/conventions featuring non-introductory Python

2006-04-06 Thread Jeff
e me, Web 2.0--conference, in Portland and SF respectively. Before I commit to one of those, I'd like to make sure there's nothing else I'm missing out on. Thanks for any tips or pointers, Jeff -- http://mail.python.org/mailman/listinfo/python-list

Re: DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-03 Thread Jeff Schwab
On 2013-07-03 13:19:26 +, Steven D'Aprano said: On Wed, 03 Jul 2013 14:00:49 +0100, Tim Golden wrote: Goodness, I doubt if you'll find anyone who can seriously make a case that the Windows command prompt is all it might be. I'm not a Powershell user myself but people speak highly of it.

Re: Inheritance Question

2012-10-18 Thread Jeff Jeffries
On Thu, Oct 18, 2012 at 10:51 AM, Dave Angel wrote: > On 10/18/2012 10:10 AM, Jeff Jeffries wrote: > > Hello everybody > > > > When I set "AttributeChanges" in my example, it sets the same value for > all > > other subclasses. Can someone help me wi

Recommended way to unpack keyword arguments using **kwargs ?

2012-10-26 Thread Jeff Jeffries
way to get keyword arguments (or default) when using ** notation? -- Cheerios, Jeff Jeffries III CFO: www.touchmycake.com <http://www.willyoubemyfriend.com> -- http://mail.python.org/mailman/listinfo/python-list

Re: Proper place for everything

2012-11-04 Thread Jeff Jeffries
ere both parties listen to > > >>each other, feel free to raise them here. Keep in mind three things: > > > > [snip three things] > > > > > You forgot the fourth point. > > > > Apparently so did you :) > > "Amongst the points are such diverse elements as..." > -- > http://mail.python.org/mailman/listinfo/python-list > -- Cheers, Jeff Jeffries III CEO: www.willyoubemyfriend.com -- http://mail.python.org/mailman/listinfo/python-list

Re: License status of pycollada?

2013-01-08 Thread Jeff Terrace
Hi Gene, I'm the maintainer of pycollada. No such paywall exists, and a login is not required. I'm not sure how you came across that. As Chris said, it's a standard BSD license. I'd be happy to help with packaging, so feel free to contact me. Jeff -- http://mail.python.

A possible change to decimal.Decimal?

2012-03-02 Thread Jeff Beardsley
HISTORY: In using python 2.7.2 for awhile on a web project (apache/wsgi web.py), I discovered a problem in using decimal.Decimal. A short search revealed that many other people have been having the problem as well, in their own apache/wsgi implementations (django, mostly), but I found no rea

Re: A possible change to decimal.Decimal?

2012-03-02 Thread Jeff Beardsley
7;t really want to start digging around in there either) The patch in this case is very limited in scope, and all it inflicts on the subject code inside of decimal.Decimal.__new__(), is better programming practices. --jeff On Fri, Mar 2, 2012 at 5:49 PM, Ethan Furman wrote: > Jeff Be

IronPython 2.7 Now Available

2011-03-12 Thread Jeff Hardy
erous improvements is that IronPython’s startup time has decreased by 10% when compared to IronPython 2.6.1. This is the first full community release of IronPython, and I want to give a huge thank you to everyone who was involved in this release. - Jeff -- http://mail.python.org/mailman/lis

Project Structure for Backend ETL Project

2018-08-21 Thread Jeff M
Is this a good example to follow for a project that does mostly python to interact with external data sources including files, transformation, and import into Postgres? https://github.com/bast/somepackage I have a SWE background but not with python, and I want to make sure my team is following

Is pypi the best place to find external python packages?

2018-08-21 Thread Jeff M
are there other places also? On pypi I did not see anywhere the status of defects or downloads, if it's actively supported. -- https://mail.python.org/mailman/listinfo/python-list

Re: Is pypi the best place to find external python packages?

2018-08-21 Thread Jeff M
On Tuesday, August 21, 2018 at 9:48:50 AM UTC-6, Jeff M wrote: > are there other places also? On pypi I did not see anywhere the status of > defects or downloads, if it's actively supported. nevermind, i see the info i was looking for on the left side. -- https://mail.python.

AES Encryption/Decryption

2018-11-02 Thread Jeff M
Python newbie here, looking for code samples for encrypting and decrypting functions, using AES. See lots of stuff on the interwebs, but lots of comments back an forth about bugs, or implemented incorrect, etc... I need to encrypt some strings that will be passed around in URL, and then also s

Re: Unacceptable behavior

2016-04-10 Thread Jeff Schumaker
ome unnecessary rudeness on the part of one of the respondants to the original post Jeff -- https://mail.python.org/mailman/listinfo/python-list

Re: Unacceptable behavior

2016-04-10 Thread Jeff Schumaker
On Sunday, April 10, 2016 at 1:15:18 PM UTC-4, [email protected] wrote: > On Sunday, April 10, 2016 at 2:54:45 PM UTC+1, Jeff Schumaker wrote: > > On Thursday, April 7, 2016 at 2:50:32 AM UTC-4, Ethan Furman wrote: > > > On 04/05/2016 01:05 PM, Thomas '

Re: Unacceptable behavior

2016-04-10 Thread Jeff Schumaker
On Sunday, April 10, 2016 at 10:03:37 AM UTC-4, Chris Angelico wrote: > On Sun, Apr 10, 2016 at 11:54 PM, Jeff Schumaker wrote > > As a new member of this group, I am not sure on how to report unacceptable > > behavior. If this is not the correct way, I apologize. > >

Re: Unacceptable behavior

2016-04-10 Thread Jeff Schumaker
On Sunday, April 10, 2016 at 9:33:47 PM UTC-4, Jeff Schumaker wrote: > On Sunday, April 10, 2016 at 10:03:37 AM UTC-4, Chris Angelico wrote: > > On Sun, Apr 10, 2016 at 11:54 PM, Jeff Schumaker wrote > > > > As a new member of this group, I am not sure on how to repor

Python 3.8 and :=

2019-12-25 Thread Jeff Gitlin
With the new operator := in Python 3.8 that allows you to do things like if ( x := f() ) == 1: Is there any reason to use just the assignment operator? -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.8 and :=

2019-12-25 Thread Jeff Gitlin
On Wednesday, December 25, 2019 at 9:22:56 AM UTC-5, Chris Angelico wrote: > On Thu, Dec 26, 2019 at 1:16 AM Jeff Gitlin wrote: > > > > With the new operator := in Python 3.8 > > that allows you to do things like > > > > if ( x := f() ) == 1: > > > > I

Re: Python 3.8 and :=

2019-12-25 Thread Jeff Gitlin
On Wednesday, December 25, 2019 at 9:13:09 AM UTC-5, Jeff Gitlin wrote: > With the new operator := in Python 3.8 > that allows you to do things like > > if ( x := f() ) == 1: > > Is there any reason to use just the assignment operator? ……….. Thanks. That web page is

Fwd: [BUG] missing ')' causes syntax error on next line

2020-07-22 Thread Jeff Linahan
-- Forwarded message - From: Jeff Linahan Date: Wed, Jul 22, 2020, 5:23 PM Subject: Fwd: [BUG] missing ')' causes syntax error on next line To: Subscribing to the mailing list as per the bot's request and resending. -- Forwarded message - Fro

Re: Fwd: [BUG] missing ')' causes syntax error on next line

2020-07-23 Thread Jeff Linahan
Interesting PEG thing. C++ compilers are getting better at suggesting fixes for minor syntax errors (in 2011 on MSVC I remember seeing pages of errors for forgetting a semicolon after a struct.) but python seems to be lagging behind in this regard.. will check out superhelp, maybe it'll help me pa

Character Sequence Generation

2005-09-22 Thread Jeff Schwab
What's the best way to generate a sequence of characters in Python? I'm looking for something like this Perl code: 'a' .. 'z' . -- http://mail.python.org/mailman/listinfo/python-list

Re: Character Sequence Generation

2005-09-22 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > Jeff Schwab wrote: > >>What's the best way to generate a sequence of characters in Python? I'm >>looking for something like this Perl code: 'a' .. 'z' . > > >>>>import string > > >>>&

Re: What is "self"?

2005-09-23 Thread Jeff Schwab
Rick Wotnaz wrote: > Roy Smith <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > > >>Ron Adam <[EMAIL PROTECTED]> wrote: >> >>>You can actually call it anything you want but "self" is sort >>>of a tradition. >> >>That's true, but I think needs to be said a bit more >>emphatically. There'

Re: Character Sequence Generation

2005-09-23 Thread Jeff Schwab
Pedro Werneck wrote: > On Thu, 22 Sep 2005 23:26:58 -0400 > Jeff Schwab <[EMAIL PROTECTED]> wrote: > > >>What's the best way to generate a sequence of characters in Python? >>I'm looking for something like this Perl code: 'a' .. 'z&

Re: Best practices for dynamically loading plugins at startup

2005-09-25 Thread Jeff Schwab
Christoph Haas wrote: > Dear coders... > > I'm working on an application that is supposed to support "plugins". > The idea is to use the plugins as packages like this: > > Plugins/ > __init__.py > Plugin1.py > Plugin2.py > Plugin3.py > > When the application starts up I want to have thes

Re: Best practices for dynamically loading plugins at startup

2005-09-26 Thread Jeff Schwab
Christoph Haas wrote: > On Sun, Sep 25, 2005 at 11:33:03PM -0400, Jeff Schwab wrote: > >>I recently came up against this exact problem. My preference is to have >>the plugin writer call a method to register the plugins, as this allows >>him the most control. Som

Re: 1 Million users.. I can't Scale!!

2005-09-28 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > Damjan> Is there some python module that provides a multi process Queue? > > Skip> Not as cleanly encapsulated as Queue, but writing a class that > Skip> does that shouldn't be all that difficult using a socket and the > Skip> pickle module. > > Jere

Re: 1 Million users.. I can't Scale!!

2005-09-28 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > Jeff> How many are more than "a few?" > > I don't know. What can you do today in commercial stuff, 16 processors? > How many cores per die, two? Four? We're still talking < 100 processors > with access to the same chun

Re: converting Word to MediaWiki

2005-09-28 Thread Jeff Schwab
ChiTownBob wrote: > Perl just sucks, as all good Python hackers know! I disagree. Perl has saved my butt more times than I care to count. Python certainly has its advantages, but I won't be giving up Perl any time soon. -- http://mail.python.org/mailman/listinfo/python-list

Re: A rather unpythonic way of doing things

2005-09-29 Thread Jeff Schwab
Peter Corbett wrote: > One of my friends has recently taken up Python, and was griping a bit > about the language (it's too "prescriptive" for his tastes). In > particular, he didn't like the way that Python expressions were a bit > crippled. So I delved a bit into the language, and found some sour

Re: A rather unpythonic way of doing things

2005-09-29 Thread Jeff Schwab
fraca7 wrote: > Richie Hindle a écrit : > >> [Peter] >> >>> http://www.pick.ucam.org/~ptc24/yvfc.html >> >> >> >> [Jeff] >> >>> Yuma Valley Agricultural Center? >>> Yaak Valley Forest Council? >> >>

Re: 1 Million users.. I can't Scale!!

2005-09-29 Thread Jeff Schwab
Aahz wrote: > In article <[EMAIL PROTECTED]>, > Jeff Schwab <[EMAIL PROTECTED]> wrote: > >>Sure, multiple machines are probably the right approach for the OP; I >>didn't mean to disagree with that. I just don't think they are "the >>only

Re: Distributing programs

2005-10-02 Thread Jeff Schwab
Jason wrote: > A non-python programming friend of mine has said that any programs made > with Python must be distributed with, or an alternative link, to the > source of the program. > > Is this true? Sorta, but not really. Typically, you might distribute the source (.py) files, but if you

Re: Program help

2005-10-02 Thread Jeff Schwab
FX wrote: > can anybody write a code for a program that reads from a > /location/file & according to file contents, it execute script. e.g. if > file contains "mp" it runs media player. > I hope the code is small .. plz help me out! You might be interested in the FileInfo class, defined and thorou

Re: Learning Python

2005-10-10 Thread Jeff Fox
Lots of links to all levels of tutorials and documentation here: http://www.awaretek.com/plf.html Python Podcast too! -- http://mail.python.org/mailman/listinfo/python-list

DFW Pythoneer Meetings This Week

2005-11-08 Thread Jeff Rush
The DFW Pythoneers maintain a club wiki/mailing list at: http://www.python.org/dfw Hope to see you there, and especially some new faces! Jeff Rush, DFW Pythoneers Coordinator -- http://mail.python.org/mailman/listinfo/python-list

Re: Speed ain't bad

2005-01-03 Thread Jeff Shannon
then the 'if ...' might be slightly faster, even though the exception-based route is more Pythonic. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: what is lambda used for in real code?

2005-01-03 Thread Jeff Shannon
on body rather than burying that manipulation somewhere in the argument list. Personally I'd call this a wash, though I expect that others will disagree with me. ;) And whatever the merits of this particular case, similar cases may not be so easy to avoid in this fashion... Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Controlling newlines when writing to stdout (no \r\n).

2005-01-03 Thread Jeff Epler
setmode(sys.stdout.fileno(), os.O_BINARY) Thanks, Google & the Python Cookbook website! Jeff pgponre4gehsj.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Help clean up clumsy code

2005-01-04 Thread Jeff Shannon
7;s version works on strings (and unicode objects) because they lack an __iter__() method, even though they follow the (older) sequence protocol. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Lambda as declarative idiom

2005-01-04 Thread Jeff Shannon
maybe even a new process or thread... d = a + e(3) I see this as simply a combination of both of the aforementioned concepts -- argument control plus moment-of-evaluation control. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.4 on Windows XP

2005-01-05 Thread Jeff Shannon
troubleshoot a bit more effectively. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.4 on Windows XP

2005-01-05 Thread Jeff Shannon
ctive mode, and since you didn't give it a script to run, it simply started, found nothing to do, and then terminated itself. You need to run idle.pyw, *not* pythonw.exe. The idle.pyw script runs inside the pythonw.exe interpreter, but the latter can't do anything without instruc

Re: What could 'f(this:that=other):' mean?

2005-01-05 Thread Jeff Shannon
anted (2), perhaps function calls are first in the queue for syntactic sugar. Huh? How much simpler of syntax do you want for calling a function? I'm not sure what you'd want as "sugar" instead of funcname(). Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: The Industry choice

2005-01-06 Thread Jeff Shannon
but shrewd risk-taking -- if you take a one-in-three chance of making a tenfold return on investment, then 66% of the time you'll lose but if you hit those odds just once, you'll come out way ahead.) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: What could 'f(this:that=other):' mean?

2005-01-06 Thread Jeff Shannon
Jonathan Fine wrote: Jeff Shannon wrote: Jonathan Fine wrote: Giudo has suggested adding optional static typing to Python. (I hope suggested is the correct word.) http://www.artima.com/weblogs/viewpost.jsp?thread=85551 An example of the syntax he proposes is: > def f(this:that=ot

Re: sorting on keys in a list of dicts

2005-01-06 Thread Jeff Shannon
) in L2] 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 here? Jeff Shannon Technician/Pr

Re: The Industry choice

2005-01-06 Thread Jeff Shannon
attempt to *encourage* hardworking programmers to share in a public commons, by ensuring that what's donated to the commons remains in the commons. 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-06 Thread Jeff Shannon
special cases aren't special enough to break the rules". Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: The Industry choice

2005-01-06 Thread Jeff Shannon
many open variables to consider. One can't control for all of them in experiments (what few experiments are practical in social sciences, anyhow), and they make any anecdotal evidence hazy enough to be suspect. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.or

Re: Securing a future for anonymous functions in Python

2005-01-06 Thread Jeff Shannon
Paul Rubin wrote: Jeff Shannon <[EMAIL PROTECTED]> writes: It seems to me that in other, less-dynamic languages, lambdas are significantly different from functions in that lambdas can be created at runtime. What languages are those, where you can create anonymous functions at runtime, b

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 difficul

Re: The Industry choice

2005-01-07 Thread Jeff Shannon
duct in which your code is linked together with LGPL'ed code 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 d

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.

Re: Calling Function Without Parentheses!

2005-01-07 Thread Jeff Shannon
a questionable usage is an error 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 mi

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Jeff Shannon
quot;integers". With all 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

Re: Powerful CGI libraries for Python?

2005-01-10 Thread Jeff Reavis
You may want to check out Spyce http://spyce.sourceforge.net/index.html It will work as cgi (or using fast cgi or mod python) and has templating, session support, active tags, etc. -jjr -- http://mail.python.org/mailman/listinfo/python-list

Re: Securing a future for anonymous functions in Python

2005-01-10 Thread Jeff Shannon
ry rat, at least, map/lambda was always a nasty puzzle for me 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

Re: Securing a future for anonymous functions in Python

2005-01-11 Thread Jeff Shannon
enough that lambda would be undesireable 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 Sha

Re: python3: 'where' keyword

2005-01-11 Thread Jeff Shannon
de of someone who wants 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-t

Re: reference or pointer to some object?

2005-01-11 Thread Jeff Shannon
mutate it. Since it's the same object, it doesn't matter where the mutation happened. But in rebind(), we're moving the somedict label to a *new* dict object. Now d and somedict no longer point to the same object, and when the function ends the object pointed to by so

Re: python guy ide

2005-01-11 Thread Jeff Shannon
command shell open. Edit, 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: 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 Internati

Re: Refactoring; arbitrary expression in lists

2005-01-12 Thread Jeff Shannon
;cc"): return extToMimeDict["cpp"] If the intent of this is to catch .cc files, it's easy to add 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
nd) to map/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 Int

Re: reference or pointer to some object?

2005-01-12 Thread Jeff Shannon
acking) and use exceptions 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://mai

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

2005-01-13 Thread Jeff Shannon
your nested function would have access to the outer namespace via normal nested scopes, so I'm 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 c

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 obj

Re: Refactoring; arbitrary expression in lists

2005-01-13 Thread Jeff Shannon
dicts 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
B now. 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

Re: finding/replacing a long binary pattern in a .bin file

2005-01-13 Thread Jeff Shannon
is simpler. (For a large file, chunking it might be necessary, though...) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: reference or pointer to some object?

2005-01-13 Thread Jeff Shannon
s s = func(s) This seems to be a way to go, but it becomes messy if i hand over lots of parameters and expect some more return functions. This has the advantage of being explicit about s being (potentially) changed. References, in the way that you mean them, are even messier in the case of nume

Re: Octal notation: severe deprecation

2005-01-13 Thread Jeff Epler
03 10x97 ... so that 0x8 and 16x8 would be different? So that 2x1 and 2x01 would be different? Jeff pgpSp55b8TgYd.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: directory bug on linux; workaround?

2005-01-13 Thread Jeff Epler
be found by "grep _SUPER_MAGIC /usr/include/linux/*" Jeff pgp3igY0cKFnR.pgp Description: PGP signature -- 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
for RNA sequences 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 Tec

Re: hash patent by AltNet; Python is prior art?

2005-01-17 Thread Jeff Shannon
ings get too bad here, I'd like to have somewhere pleasant to emigrate to. ;) Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Fuzzy matching of postal addresses

2005-01-17 Thread Jeff Shannon
a more-detailed matching, you might look into finding an algorithm to determine the "distance" between two strings and using that to score possible matches. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: macros

2005-01-18 Thread Jeff Shannon
anageable level. To rephrase this a bit 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
ol over the circumstances in which your Singleton 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 --

Re: Zen of Python

2005-01-19 Thread Jeff Shannon
uch closer to the "completely flat" side of things. It's not "... as nested (or as flat) as you have 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: why am I getting a segmentation fault?

2005-01-21 Thread Jeff Shannon
ore robust (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
ot;a:b:c".split(':') >>> o = LineObj(*l) >>> o.__dict__ {'a': 'a', 'c': 'c', 'b': 'b', 'e': None, 'd': None} >>> This is a bit more likely to be meaningful, in that there's

Re: Classical FP problem in python : Hamming problem

2005-01-23 Thread Jeff Epler
ultiply by N" function as well as one to be the return value. Here's my implementation, which matched your list early on but effortlessly reached larger values. One large value it printed was 6412351813189632 (a Python long) which indeed has only the distinct prime factors 2 and 3. (2**43

Re: Tuple slices

2005-01-24 Thread Jeff Epler
of storing variable-size Python objects was chosen in part because it reuqires only one allocation for an object, not two. However, there is no way for one tuple to point to a slice of another tuple. there's no reason that some other python implementation couldn't make a different cho

Re: Tuple slices

2005-01-24 Thread Jeff Shannon
mory allocation, and for a reasonable tuple the size of the memory required is not going to significantly affect the allocation time. Jeff Shannon Technician/Programmer Credit International -- http://mail.python.org/mailman/listinfo/python-list

Re: Another scripting language implemented into Python itself?

2005-01-24 Thread Jeff Shannon
cripts, you'll probably have the same 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 Internatio

Re: is this use of lists normal?

2005-01-24 Thread Jeff Shannon
e in a master dictionary keyed by id -- in other words, simply replace the tuples in my previous example with a dict like what you've got here. You could also create a simple class to hold each item, rather than using small dicts. (You'd probably still want to store class instances in a master dict keyed by id.) Generally, any time 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: Classical FP problem in python : Hamming problem

2005-01-25 Thread Jeff Shannon
ng 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

<    1   2   3   4   5   6   7   8   9   10   >