bblais wrote:
> Hello,
>
(snip)
>
> In C++, I open up an editor in one window, a Unix shell in another.
(snip)
> In Matlab, I do much the same thing, except there is no compile phase.
(snip)
> In Python, there seems to be a couple ways of doing things. I could
> write it in one window, and fro
Mike Meyer wrote:
(snip)
> Maybe
> some of the people who IDEs (instead of - well, we need a term for
> development environment built out of Unix tools)
"Extegrated Development environment" ?-)
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p
Fried Egg wrote:
> I must not express myself very clearly.
>
> I don't need any help with the disassociated text algorithm. What I
> need is a framework for data processing web apps,
If that's your main need, and you want to use a RDBMS, then you may want
to have a l
WIdgeteye wrote:
> HI,
> I am trying to write a little program that will run a program on
> scedule.
There are usually existing programs to do so on most platforms (cron on
*n*x, the Windows scheduler, etc).
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('
Moneyhere wrote:
> Good :)
> Can someone provide this ebook? .
> I'm looking forwards it.
>
http://www.amazon.com/gp/product/0130410659/002-1715230-0496030?v=glance&n=283155
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.
Manoj Kumar P wrote:
> Hi,
>
> Can anyone tell me a good python editor/IDE?
> It would be great if you can provide the download link also.
I hate to be the one answering this, but this is *really* a FAQ - as you
would have known if you had google'd this group for this.
--
bruno desthuilliers
py
Ray wrote:
> In our field, we don't always get to program in the language we'd like
> to program. So... how do you practice Python in this case? Say you're
> doing J2EE right now.
Hopefully not !
> How do you practice Python to keep your skills
> sharp?
How *would* I do ? Well, perhaps I'd use J
Ray wrote:
> OK, maybe I shoot a more general question to the group since there are
> so many great programmers here: how do you practice your craft?
I'm certainly not one of them, but...
(snip)
> How do you do your practice?
>
1/ programming
2/ programming
3/ lurking here, reading posts and so
Arthur Pemberton wrote:
> What is the best way to do data source abtraction? For example have
> different classes with the same interface, but different
> implementations.
>
> I was thinking of almost having classA as my main class, and have
> classA dynamically "absorb" classFood into to based on
Ray wrote:
> bruno at modulix wrote:
>
>>>In our field, we don't always get to program in the language we'd like
>>>to program. So... how do you practice Python in this case? Say you're
>>>doing J2EE right now.
>>
>>Hopefully not !
>
Ray wrote:
> bruno at modulix wrote:
>
>>1/ programming
>>2/ programming
>>3/ lurking here, reading posts and sometimes trying to answer, reading
>>source code of the oss apps/frameworks I'm working with, searching
>>practical solutions in the cookbo
Peter Otten wrote:
> Eric Brunel wrote:
>
>
>>My actual question is: why does it work in one case and not in the other?
>>As I see it, int is just a function with one parameter, and the lambda is
>>just another one. So why does the first work, and not the second? What
>>'black magic' takes place
unc-vs-meth.py", line 18, in ?
> o2 = C2()
> File "func-vs-meth.py", line 5, in __init__
> self.x = self.f(0)
> TypeError: () takes exactly 1 argument (2 given)
Not surprising at all.
Functions implement the descriptor protocol[1]. When bound to a class
and looked up vi
A.M wrote:
> Hi,
>
>
>
> I am using Python 2.4. I read the PEP 308 at:
>
> http://www.python.org/dev/peps/pep-0308/
>
> I tried the statement:
>
> a= "Yes" if 1==1 else "No"
>
> but the interpreter doesn't accept it.
>
Marvin wrote:
> Hi,
>
> It's been claimed
s/claimed/observed/
In Python and Ruby, class hierarchies tends to be *really* flat when
compared to Java or C++.
> that inheritance structures are less important in dynamic
> languages like Python. Why is that
Don't you guess ?-)
A very obvious poin
built-in func to build a
> static field ( something like staticfield() )
Please define "static field", I just don't understand what it could be.
Now if what you want is a class attribute (ie: an attribute that is
shared by all instances of a class), just declare it at the class level:
import *
>>>> test1
>
>>>> test2
> Traceback (most recent call last):
> File "", line 1, in ?
> NameError: name 'test2' is not defined
> So it seems that I am very limited in the number of subpackages I can
> create.
Not at all.
&g
ently and don't care about
files being human-readable, you may be better using some lightweight
database system (berkeley, sqlite,...) or any other existing lib that'll
take care of gory details.
Else - if you want/need to stick to human readable flat text files - at
least write a solid l
alf wrote:
> Hi,
>
> Would it be .append()? Does it reallocate te list with each apend?
>
> l=[]
> for i in xrange(n):
> l.append(i)
>
FWIW, you'd have the same result with:
l = range(n)
More seriously (and in addition to other anwsers): you can also
construct a list in one path:
l
re next in my code, i will check for these..:
>>>
>>> 1) -A and -B cannot exist together
>>> 2) -A and -C cannot exist together
>>> 3) -A and -B and -D cannot exist together
>>> 4) and lots of other combinations to check for
>>
>>
>>
Rene Pijlman wrote:
> bruno at modulix:
>
>>You can't do this in place with a text file (would be possible with a
>>fixed-length binary format).
>
>
> More precise: it's possible with any fixed-length change, in both binary
> and text files, with both fix
hacker1017 wrote:
> im just asking out of curiosity.
>
Err... Programming ?-)
Sorry...
Actually, mostly web applications (CMS, groupware, small/medium business
apps etc), and admin utilities.
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in
Tommy B wrote:
> bruno at modulix wrote:
(snip)
>>import os
>>old = open("/path/to/file.txt", "r")
>>new = open("/path/to/new.txt", "w")
>>for line in old:
>> if line.strip() == "Bob 62"
>>line = line.
Christophe wrote:
> bruno at modulix a écrit :
(snip)
>> Wrong guess - unless, as Fredrik suggested, you have an infinite disk
>> with an infinite file on it. If so, please share with, we would be
>> *very* interested !-)
>
>
> Use /dev/zero as source and /d
ent()
This won't work - will raise a TypeError. You defined Student.__init__()
to take 2 mandatory parameters name and id,so you must pass them at call
time.
FWIW, you would have noticed this just by trying it into your Python
shell. The interactive Python shell is a very valuable tool. It mak
[EMAIL PROTECTED] wrote:
> Hi,
> I am developing a code which has MVC (Model - View - Controler)
> architecture.My view is in .NET. And my controller is in Python.So can
> i call Python script from .NET?
This is a question that I would have asked myself before actually trying
to do anything el
Bryan wrote:
> does anyone know if there is a collection somewhere of common python
> mistakes or inefficiencies or unpythonic code that java developers make
> when first starting out writing python code?
Try googling for "python is not java" !-)
--
bruno desthuilliers
python -c "print '@'.joi
Shani wrote:
> I have the following code which takes a list of urls
> "http://google.com";, without the quotes ofcourse, and then saves there
> source code as a text file. I wan to alter the code so that for the
> list of URLs an html file is saved.
What you write in a text file is up to you - an
Tim Roberts wrote:
> John Salerno <[EMAIL PROTECTED]> wrote:
>
>
>>Bruno Desthuilliers wrote:
>>
>>>John Salerno a écrit :
>>>
>>>>If I want to get all the values that are entered into an HTML form and
>>>>write them to a file
alf wrote:
> is there any way to tell the class the base class during runtime?
>
Technically, yes - the solution depending on your definition of "during
runtime"
FWIW, the class statement is evaled at import/load time, which is
"during runtime" So if you want to us
> main function, i have defined the other functions such as
> genColocations,genTableInstances,etc. Output of genColocations is to be
> given to the next function genTableInstances,output of this function to
> tiCount and findPI, and so on.
> However i am getting an error at the line m
baalbek wrote:
> To score with the chicks!
>
> A Python script roams the nightclubs for beautiful women, finds an
> appropriate woman based on my preferances, charms her with its sleek
> Pythonic manners, calls for a cab and brings the lady to my recidency.
>
> Works like a charm!
Is that OSS ?-
Girish Sahani wrote:
>>Girish Sahani wrote:
>>
>>
>>>However i am getting an error at the line marked with ***.
>>
>>what error ?
>
> ...line 266, in colocationMiner
Great. We now know at which line of an unknown file an unknown error
happens. W
JD wrote:
> Hello,
>
> I try to remove a dictionary key-pair (remove an entry),
> but I'm unsuccessful. Does anyone know how to achieve this?
>
> Thanks
mydict = {"key" : "value"}
del mydict(key)
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p
bruno at modulix wrote:
> JD wrote:
>
>>Hello,
>>
>>I try to remove a dictionary key-pair (remove an entry),
>>but I'm unsuccessful. Does anyone know how to achieve this?
>>
>>Thanks
>
>
> mydict = {"key" : "value&qu
zefciu wrote:
> Hello!
>
> Where can I find a good explanation when does an interpreter copy the
> value, and when does it create the reference.
Unless you explicitely ask for a copy (either using the copy module or a
specific function or method), you'll get a reference.
> I thought I understan
[EMAIL PROTECTED] wrote:
>>Where can I find a good explanation when does an interpreter copy the
>>value, and when does it create the reference.
>
> Any good Python book. I have Learning Python and Programming Python 2nd
> edition and they are very good IMO.
>
>
>>I thought I understand
>>it, bu
[EMAIL PROTECTED] wrote:
> hi
>
> i created a script to ask user for an input that can be a pattern
> right now, i use re to compile that pattern
> pat = re.compile(r"%s" %(userinput) ) #userinput is passed from
> command line argument
> if the user key in a pattern , eg [-] , and my script will
tances,output of this function to
>>>tiCount and findPI, and so on.
>>>However i am getting an error at the line marked with ***.
>>
>>Which error ? How do you hope us to be of any help here if you don't *at
>>least* provide the full traceback ? FWIW, the can
Redefined Horizons wrote:
> I've been hearing a ot about AJAX lately. I may have to build a web
> application in the near future, and I was curoius:
>
> How does a web application that uses Python compare with one that uses
> AJAX?
How does a car that has a diesel motor compare with one that is r
[EMAIL PROTECTED] wrote:
(meta : please don't top-post)
> Intuitively, the name lookup on
> self.parent.foo would be faster than if you passed in the object in
> question
Each dot means doing a lookup in a namespace. The more dots, the more
lookups. And lookups do have a cost.
--
bruno desthui
ery defined meaning in Python - a
class method is a method that takes the class object - not the instance
- as first param.
> can refer to, vs. some other organization ?
> Should all relevant objects/vars just be passed into the method as needed?
There's no absolute rule about this
>
You did not test this code, did you ?
>>> getl5()
Traceback (most recent call last):
File "", line 1, in ?
File "/usr/tmp/python-961l_S.py", line 7, in getl5
NameError: global name 'element' is not defined
>>>
The SimpleStupid(tm) way to do this
Girish Sahani wrote:
(please don't top-post)
> Hey Bruno...you are seeing the wrong post :P...please ignore this and
> check out the one with (corrected) appended at the end...
You should have posted the correction in the same thread.
> Also, i used the list comprehension thing
MTD wrote:
> Hello,
>
> I'm wondering if there's a quick way of resolving this problem.
>
> In a program, I have a list of tuples of form (str,int), where int is a
> count of how often str occurs
>
> e.g. L = [ ("X",1),("Y",2)] would mean "X" occurs once and "Y" occurs
> twice
>
> If I am given
[EMAIL PROTECTED] wrote:
> bruno at modulix wrote:
>
>>[EMAIL PROTECTED] wrote:
>>
>>> Intuitively, the name lookup on
>>>self.parent.foo would be faster than if you passed in the object in
>>>question
>>
>>
>>Each dot means doing
[EMAIL PROTECTED] wrote:
> Several times I logged-in successfully but after log-in I can't use
> features/services which were shown prior to my login. Can anyone exoert
>
> from this forum check , is it technical fault of Bank Web Site or this
> problem pertaining to the user(me).
It's definitiv
[EMAIL PROTECTED] wrote:
> I have posted the same question in alt.html but no one yet replied.
You should ask your butcher. Now please stop posting off-topic.
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
Ben Finney wrote:
(snip)
> if __name__ == "__main__":
> test_funcs = [x for name, x in globals()
> if name.startswith("test") and hasattr(x, "__call__")
> ]
Any reason not to use callable(x) here ? (instead of hasattr(x, "__call__"))
--
bruno desthuilliers
python
Rosario Morgan wrote:
> Hello
>
> Help is great appreciated in advance.
>
> I need to loop through a file 6000 bytes at a time. I was going to
> use the following but do not know how to advance through the file 6000
> bytes at a time.
>
> file = open('h
jkn wrote:
> Hi all
> I'm trying out, and in general finding really useful, the various
> TiddlyWiki variants that I guess many people here know about, for
> organising my activities in a GTD way. One mild annoyance is in the
> speed of the Javascript applications. I
jkn wrote:
(snip)
> Does the idea of embedding python in a browser instead of Javascript
> make any sense at all?
>From a purely theoretical POV, yes, this idea makes sens - Python could
be an interesting alternative to javascript for client-side scripting
(and I'd really prefer us
Quacker wrote:
> Very interesting!
>
indeed.
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
--
http://mail.python.org/mailman/listinfo/python-list
JH wrote:
> Hi
>
> Can anyone explain to me why the following codes do not work? I want to
> try out using __cmp__ method to change the sorting order. I subclass
> the str and override the __cmp__ method so the strings can be sorted by
> the lengh. I expect the shortest string should be in the fro
[EMAIL PROTECTED] wrote:
(snip)
> i have a few questions about Python
>
> 1. Can Python work with databases like MySql,Oracle? (i think it sounds
> silly)
http://www.google.com/search?q=%2Bpython+%2Bdb
> 2.the Python files have .py extension and i used Windows Command
> Prompt(DOS) to execute th
to effectively use a powerful and
extensible test editor is the WiseThingTodo(tm).
> (probably Vim,
> since I hear it's lighter and faster).
It's a bit faster at startup, yes. Else, I'm not sure it makes a real
difference wrt/ performances and power. It's more a matter
BartlebyScrivener wrote:
> I see Eclipse mentioned here a lot.
If you go for a Mammoth-weight GUI-only Java IDE and have a really
powerful computer, why not ?
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
-
John Salerno wrote:
> Ant wrote:
>
>> jEdit is for me still the best text editor available. Very extensible
>> with macros (which can be written in Jython with the appropriate plugin
>> installed).
>
>
> I like the idea of being extensible, but of course I can only write in
> Python.
Jython is
BartlebyScrivener wrote:
> Emacs must be dying if this thread could get all the way to 20 with
> nobody arguing with the vi folks.
No need to argue. I started with vim, and finally switched to emacs less
than one year later.
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] f
BartlebyScrivener wrote:
>>>Most IDEs are rather weak as text editors compared to emacsen.
>
>
> That's true, but even emacs and xemacs don't offer simple automatic
> word wrap (i.e. wrap a line without splitting words or putting an eol
> or hard carriage r
BartlebyScrivener wrote:
(snip)
> Also, it seems to be a minimalist
> language.
*seems* minimalist, but is really not - have a look at the object model
(metaclasses, descriptors etc), at closures and HOFs and decorators, at
list-comp and generators and (coming in 2.5) coroutines... Defini
BartlebyScrivener wrote:
>>>I'd like something a bit like a module,
>>>but I'd like to make several of them,
>>>and not have them interfere with each other."
>
>
> Thank you. I sense what you are saying, but at this point I'd be
> thin
Scott David Daniels wrote:
> BartlebyScrivener wrote:
>
>> I am not touching OO, classes, or GUIs until I understand
>> EVERYTHING else. Could take a few years. ;)
>
>
> You know how modules separate globals, right? That is, what you
> write in one module doesn't affect the names in anothe
BartlebyScrivener wrote:
(snip)
> I am not touching OO, classes,
You may not be aware of this, but as soon as you're programming in
Python, you *are* using OO. Strings are objects, dicts are objects,
tuples are objects, lists are objects, numbers are objects, and even
functions and modules are ob
a wrote:
> thanks for reading
>
Too long experience with Paris (France) subway... Left Paris, feel
better now !-)
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
--
http://mail.python.org/mailman/listinfo/pyt
isinstance(obj, klass) instead - and yet better, don't check type at all
if you can avoid it.
> and I was just wondering whether or not
> it is considered bad practice in the Python Community to use it for
> numerics as well.
It's even worse than a bad practice : it's an er
impressed the first time - note that it was at
the very end of the last century, with v1.5.2. But still I found the
language suprisingly simple to get up and running with - seemed like the
language was almost always reading my mind about how I would have named
a librairy, function or whatever !-) S
a wrote:
> subway is pythons ruby on rails competitor
Nope - it's a Python MVC web framework. Like Django, Pylons and
Turborgears. And FWIW, there have been recently some discussions about
merging Subway and Turbogears.
> pls tell me if u hav any expereinces
Please take time to learn and write r
for a long time already, and metatypes and
> generators are having some strange unexplored possibilities too, but the
> day will come soon (and at last when PyPy is reaching execution speeds
> close to cPython) where Python will be able to swallow smaller
> languages, and finally it will b
BJörn Lindqvist wrote:
>> Personally, I would like to see macros in Python (actually Logix
>> succeeding is good enough). But I am no language designer and the
>> community has no interest in it. When I absolutely need macros, I will
>> go elsewhere.
>
>
> One must wonder, when is that? When do y
Ravi Teja wrote:
> BJörn Lindqvist wrote:
>
>>>Personally, I would like to see macros in Python (actually Logix
>>>succeeding is good enough). But I am no language designer and the
>>>community has no interest in it. When I absolutely need macros, I will
>>>go elsewhere.
>>
>>One must wonder, when
Ravi Teja wrote:
(snip)
> Annoted variables, symbols and code
> layout visually cue more efficiently to the object nature than do
> explicit text definitions. Of course, this is only sensible when there
> aren't too many of any of those. In that case, the cognitive cost of
> notation outweighs the
[EMAIL PROTECTED] wrote:
> How to check if a file is closed?
>>> f = open('trashme.txt', 'w')
>>> f
>>> dir(f)
['__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__',
'__init__', '__iter__', '__new__', '__reduce__', '__reduce_ex__',
'__repr__', '__setattr__', '__str__', 'close', '
[EMAIL PROTECTED] wrote:
> I know Google are using Python for testing purposes.
Not only:
"""
Where is Python used?
* The Google build system is written in python. All of Google's
corporate code is checked into a repository and the dependency and
building of this code is managed by python.
Anton Vredegoor wrote:
> bruno at modulix wrote:
>
>> I still don't get the point.
>
>
> Well, I've got to be careful here, lest I'd be associated with the
> terr.., eh, the childp..., eh the macro-enablers.
>
> The idea is to have a way to transf
Tim Chase wrote:
>> Can you use strings or %s strings like in the above or
>>
>> aaa = 'string'
>> aaa.%s() % 'upper'
>>
>> Somehow?
>
>
> Looks like you want to play with the eval() function.
>
aaa = 'hello'
result = eval("aaa.%s()" % 'upper')
result
> 'HELLO'
Using eval() or ex
janama wrote:
> Hi,
>
> can such a thing be done somehow?
>
>
> aaa = self.aaa
> bbb = %s.%s % ('parent', 'bbb')
Given the first line, I assume this is inside a method body, and parent
is a local var. Then the answer is:
bbb = getattr(locals()['parent'], 'bbb')
read the doc for these two func
Fredrik Lundh wrote:
> Laurent Pointal wrote:
>> Bruno Desthuilliers wrote:
>>> Anton Vredegoor wrote:
The idea is to have a way to transform a Python (.py) module into XML
and then do source code manipulations in XML-space using ElementTree.
>
>>>
>
>>> My my my... I'm not against th
faulkner wrote:
(pelase don't top-post - fixed)
> aarondesk wrote:
>
(snip)
>>Now I've tried putting the function declaration after the call but the
>>program wouldn't work. Is there anyway to put function declarations at
>>the end of the program, ra
Diez B. Roggisch wrote:
>>> because lots of people know how to describe XML transformations, and
>>> there are plenty of tools that implement such transformations
>>> efficiently ?
>>
>>
>> Efficiently enough for dynamic (runtime) use ?
>
>
> Using XML-transformation for AST manipulation isn't my
Diez B. Roggisch wrote:
> bruno at modulix wrote:
>
>
>>Diez B. Roggisch wrote:
>>
>>>>>because lots of people know how to describe XML transformations, and
>>>>>there are plenty of tools that implement such transformations
>>>>>e
an iterable - and the exception
>> will
>> come from arg not being iterable.
>>
>> But what you can't do is make python complain about this:
>>
>> def f(arg):
>> for e in arg:
>> print e
>>
>>
>> f(100)
>>
&
K.S.Sreeram wrote:
> bruno at modulix wrote:
>
>> if type(arg) is type([]):
>
>
> Just a tiny nitpick
> You can just use 'list' instead of 'type([])'
I know. Note that I wrote "*A* right way to write this", not "*The*
right way
Tim Chase wrote:
(snip)
class Foo(object):
> ... def __init__(self):
> ... for method in dir(self):
> ... if method == method.strip("_"):
if not method.startswith('_'):
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([
Max M wrote:
> bruno at modulix wrote:
>
>>> Or did you just like what you saw and decided to learn it for fun?
>>
>>
>> Well, I haven't be really impressed the first time - note that it was at
>> the very end of the last century, with v1.5.2.
&g
Max M wrote:
> bruno at modulix wrote:
>
>> Max M wrote:
>>
>>> bruno at modulix wrote:
>>>
>>>>> Or did you just like what you saw and decided to learn it for fun?
>>>>
>>>>
>>>> Well, I haven't be real
Hi,
I am learning Python and want to perform what I think is a very simple
task: calculating the difference between two dates in seconds. Reading
through the documentation I am puzzled: I can't find a way to do this
without doing manually what I think belongs to a standard library
method.
Please
On 9/27/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Claes at work wrote:
>
> why would you have to do that yourself? why not let Python do it for
> you? here's the code:
>
> seconds = td.days * 86400 + td.seconds
>
Thanks, but that is exactly what I mea
perfect usecase for regexps...
> if oldname != newname:
> if os.path.isfile(newname) or os.path.isdir(newname):
> print oldname, "-->\n", newname, "\t\t\tERROR: file/dir
> exists\n"
> else:
> pr
anyway !-)
> Is this intended capability for Python
> objects,
AFAIK, yes.
> or am I taking advantage of a fortuitous accident, which may get
> undone at a future time?
It's certainly not a fortuitous accident.
--
bruno desthuilliers
python -c "print '@'.jo
e that I do NOT get the error when running the script normally from
> Python.
So I'd say it has something to do with sys.path
Is there anything "non-standard" with your config ? Like modules
installed as a user and/or outside of /usr/lib/pythonXXX/site-packages/ ?
> I have re
Danny wrote:
> I think I should paste some of the programs code a little more of what I
> want...
probably...
> var = 0
> while var <= 5:
> print a[t[var]]
> var = var +1
>
> a is a dectionary (very big) and t is a string of text. (if that's
> important right now).
It might be important
Jeffrey Schwab wrote:
> Danny wrote:
>
>> Great! It's been solved.
>>
>> The line, as Glaudio said has a "," at the end and that makes it go
>> onto one line, thanks so much man!
>>
>> var = 0
>> while <= 5:
>> print
Dave Benjamin wrote:
(snip)
> You *could* have "b.__eq__" just call "a.__eq__",
Which could lead to strange results (well, actually a good ole infinite
recursion) if b.__eq__ happens to call b.__eq__ too !-)
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split(
Mr.Rech wrote:
> All in all it seems that the implementation that uses isinstance() is
> better in this case...
You could also use something like Zope's Interfaces... But I'm not sure
it's worth the extra complexity.
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.
Daniel Nogradi wrote:
> Is it possible to have method names of a class generated somehow dynamically?
>>> class Dummy(object):
... pass
...
>>> def mymethod(self, *args, **kw):
... pass
...
>>> setattr(Dummy, 'a_dynamically_generated_method_name', mymethod)
>>>
>>> Dummy.a_dynamically_generate
Lonnie Princehouse wrote:
>>(objects are not allowed to lie about who they are, or what they are).
>
>
> Dangit! I need to find a less honest programming language. Anyone
> have a Perl cookbook handy? ...
>
+1 QOTW (approved by a fellow Perl programmer FWIW !-)
--
bruno desthuilliers
python
bruno at modulix wrote:
> Dave Benjamin wrote:
> (snip)
>
>
>>You *could* have "b.__eq__" just call "a.__eq__",
>
>
> Which could lead to strange results (well, actually a good ole infinite
> recursion) if b.__eq__ happens to call b.__eq__
Marcel Hartmann wrote:
> I'm using LDAPUserFolder for Zope 2.7.6 and it works fine.
>
> Is it possible to do the mapping to zope roles by the _value_ of the
> group and not the group name?
> We defined in LDAP many groups to define access to different
> applications - one is named "zope". I want t
Fried Egg wrote:
> This may be trivial or stupid or both, but does anyone have a recipe
> for gracefully using Cheetah to generate a text representation of an
> object, but embedded in the object (so that it can be pickled,
> unpickled, and told to display itself)?
>
> Here is what I am thinking:
101 - 200 of 607 matches
Mail list logo