Joe wrote:
> Back in March I submitted a patch for cgi.py to sourceforge to fix a problem
> with the handling of an invalid REQUEST_METHOD.
>
> I thought I followed all the steps to properly submit the bug and patch but
> the patch is still sitting there in limbo.
>
> This is the first patch I
flupke wrote:
> Hi,
>
> i have a property in a class that gets changed
> and i would want to know who changes it.
> Is there a way i can find out the calling function of a property?
You're looking for sys._getframe.
Reinhold
--
http://mail.python.org/mailman/listinfo/python-list
Michele Simionato wrote:
>> http://fuhm.org/super-harmful/
>
> That is a pretty good page; I must say that my position is more radical
> (i.e. it is not super which
> is harmful, it is multiple inheritance itself that it is harmful: was I
> going to design a new language
> I would implement it *wi
NickC wrote:
> [Re: alternatives to overloading '/']
>
> Is there a reason the Path constructor is limited to a single argument?
> If it allowed multiple arguments, the following would seem very
> straightforward:
>
> p = Path(somePath, user.getFolder(), 'archive', oldPath + ".bak")
That's a qui
Ivan Van Laningham wrote:
> Hi All--
>
> Tony Meyer wrote:
>>
>> So far, there have been various statements that look like +0 for __div__,
>> but no-one with a +1. (And I've said this a couple of times now, which
>> really is just trolling for a +1 from someone).
>>
>> > It's not a question of
Mike Orr wrote:
> The main changes I'd like to see in Path (some of these have been made
> in Python CVS at nondist/sandbox/path/path.py) are:
Thanks for the comments! They are greatly appreciated.
> - When methods create path objects, use self.__class__() instead of
> Path().
> This makes it
NickC wrote:
> [Re: how to get at the base class]
>
> Do you really want to have a "only works for Path" way to get at the
> base class, rather than using the canonical Path.__bases__[0]?
>
> How about a new property in the os.path module instead? Something like
> os.path.path_type.
>
> Then os.
Stefan Rank wrote:
> on 30.07.2005 10:20 Paolino said the following:
>> why (x**2 with(x))<(x**3 with(x)) is not taken in consideration?
>>
>> If 'with' must be there (and substitue 'lambda:') then at least the
>> syntax is clear.IMO Ruby syntax is also clear.
>>
>
> I am sorry if this has alre
Steven D'Aprano wrote:
> On Sat, 30 Jul 2005 08:13:26 -0400, Peter Hansen wrote:
>
>> Beginners should not be comparing lambdas.
>>
>> Neither should you. ;-)
>
> Actually, yes I should, because I'm trying to make sense of the mess that
> is Python's handling of comparisons. At least two differe
phil hunt wrote:
> On Fri, 29 Jul 2005 14:38:23 +1200, Tony Meyer <[EMAIL PROTECTED]> wrote:
>>> def functions_which_modifies_some_file_in_place(path):
>>> output = open(path+'.tmp', 'w')
>>> .
>>>
>>> I dont want a seperator inserted between path and the new extension.
>>
>>Fair enough. Fo
phil hunt wrote:
> def normalizePath(p, *pathParts):
>""" Normalize a file path, by expanding the user name and getting
>the absolute path..
>@param p [string] = a path to a file or directory
>@param pathParts [list of string] = optional path parts
>@return [string] = the same
Steven D'Aprano wrote:
> On Sat, 30 Jul 2005 14:10:52 +0200, Reinhold Birkenfeld wrote:
>
>> Above all, nobody can tell me that there's any programmer who doesn't
>> instantly recognize '/' as a directory separator.
>
> Is classic Macintosh OS s
Georg Neis wrote:
> * Reinhold Birkenfeld <[EMAIL PROTECTED]> wrote:
>> Steven D'Aprano wrote:
>>>>>> 1+0j == 1 > 0
>>> True
>>
>> (1+0j == 1) yields True, which is comparable to 0.
>
> "a == b > c" is equivalent
Steven D'Aprano wrote:
> On Sat, 30 Jul 2005 15:32:45 +0200, Reinhold Birkenfeld wrote:
>
>>> Um, I didn't ask to compare complex numbers using comparison operators. I
>>> asked to sort a list. And please don't tell me that that sorting is
>>>
Michael Hoffman wrote:
> Reinhold Birkenfeld wrote:
>
>> It's much the same as with @ decorators. Those who have used them much
>> don't object to the syntax any more.
>
> I do and I still think they are ugly.
Shouldn't have generalized that. Add "
Peter Hansen wrote:
> Reinhold Birkenfeld wrote:
>> Mike Orr wrote:
>>>- I saw in a thread that .name and .parent were removed. I use them
>>>very frequently, along with .ext and .namebase. I don't want to call
>>>methods for these.
>>
phil hunt wrote:
> On Sat, 30 Jul 2005 19:01:49 +0200, Reinhold Birkenfeld <[EMAIL PROTECTED]>
> wrote:
>>phil hunt wrote:
>>
>>> def normalizePath(p, *pathParts):
>>>""" Normalize a file path, by expanding the user name and getting
phil hunt wrote:
> On Sun, 31 Jul 2005 09:48:45 +0200, Reinhold Birkenfeld <[EMAIL PROTECTED]>
> wrote:
>>>
>>> An improvement to what? To how the class is implemented, or to how
>>> it is used?
>>
>>No, the second function is cleaner and more
phil hunt wrote:
> On Sun, 31 Jul 2005 12:09:48 -0700, Cliff Wells <[EMAIL PROTECTED]> wrote:
>>On Sun, 2005-07-31 at 10:07 -0700, Kay Schluehr wrote:
>>
>>> Some other people already abandoned Python not for the worst reasons:
>>>
>>> http://www.kevin-walzer.com/pivot/entry.php?id=69
>>
>>Being a
Franz Steinhaeusler wrote:
> The background:
> I want to create a code completition for an editor component.
> It should distinguish between inherited and non inherited members.
> Reason is, that on wxPython, most classes are derived from wxWindow.
> For example if I want Code completition for wx.
Kay Schluehr wrote:
> Reinhold Birkenfeld wrote:
>
>> > In practise any Python GUI is going to contain code from otyher
>> > languages since if it was coded all the way down in python it would
>> > be too slow.
>>
>> Oh, I could imagine that a MFC-li
Delaney, Timothy (Tim) wrote:
> Peter Hansen wrote:
>
>> Change those to "raise NotImplementedError('blah')" instead and you'll
>> be taking the more idiomatic approach.
>
> One thing I've noticed, which I may raise on python-dev ...
> NotImplementedError does *not* play well with super() ...
>
Bob Greschke wrote:
> Looks like the "label" system command will do it in Windows. That's good
> enough for this exercise. So, in Linux...???
"mlabel" in the "mtools" package will do what you need. "mkfs.vfat" can also
be given a volume label, but it will not allow you to set the label without
Erik Max Francis wrote:
> Daniel Schüle wrote:
>
>> maybe I confuse, in german one would say "45 Grad"
>> I took a freedom to translate it directly :)
>> well, my calculator shows a "D"
>> which most likely stands for Degree, I cannot tell for sure
>
> Probably. In English, you have degrees and
Terry Reedy wrote:
> <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Hi,
>> on startup my embedded python comes up with "import site failed use
>> -v". Later python crashes on Pyrun_file(). This is the first time I
>> have used python and I would like to know does it require site.
Kay Schluehr wrote:
> No good news for scripting-language fans:
>
> http://www.phpmag.net/itr/news/psecom,id,23284,nodeid,113.html
The study was conducted by Evans Data Corporation. Look here:
http://www.evansdata.com/n2/about_us_clients.shtml
Do you see the PSF or Larry Wall on the list?
Rein
Erik the Red wrote:
> So, I did the following:
> ---
> a=input("Give me an integer")
> b=input("Give me another integer")
>
> def gcd(a,b):
>
> if a < b:
> a, b = b, a
> while b != 0:
> a, b = b, a % b
> return a
> ---
> But, in the xterm, it terminates after "Give m
could ildg wrote:
> I want to check if a folder named "foldername" is empty.
> I use os.listdir(foldername)==[] to do this,
> but it will be very slow if the folder has a lot of sub-files.
> Is there any efficient ways to do this?
try:
os.rmdir(path)
empty = True
except OSError:
empty
Al Christians wrote:
> EP wrote:
>>
>> yes, my apologies to all things Iron and or Python.
>>
>> "language" and "version" can be confusing if one stays up late without
>> coffee, or perhaps if one has not been debugging their English code properly.
>>
>
> Still, it's a bit of a PITB to me that
Michael Hudson wrote:
> [EMAIL PROTECTED] writes:
>
>> On Sat, Aug 06, 2005 at 05:15:22PM -0400, Terry Reedy wrote:
>>> In any case letting developers add new features is part of the price of
>>> getting unpaid bug fixes for free software. But note that PSF does not
>>> make you to upgrade. He
Evil Bastard wrote:
> bruno modulix wrote:
>> You can tell buy the most common use. bash is a scripting language,
>> javascript is a scripting language, perl is a scripting language, php is
>> a scripting language, Python is *not* a scripting language !-)
>
> Perhaps a better definition - the term
Rex Eastbourne wrote:
> Thanks. I adapted it a bit:
>
> def debug(foo):
> print foo, 'is:'
> exec('pprint.pprint(' + foo + ')')
>
> But I'm getting "NameError: name 'foo' is not defined," since foo is
> not defined in this scope. (The function works beautifully when I'm
> dealing with glo
BranoZ wrote:
> Paul Watson wrote:
>> Using a '$' before the string works in the ksh that is part of FC4.
>> However, it does not work on the pdksh that is in FC3 and Cygwin. It
>> also does not work on AIX ksh.
>>
>> $ print $'now'
>> $now
>
> In bash you can also use Ctrl-v followed by special
Dan wrote:
>> http://www.python.org/doc/2.4.1/lib/node110.html
>>
>> These methods are being deprecated. What are they being replaced
>> with?
>
> They're being made methods of the string class itself.
>
> For example:
> >>> s = 'any old string'
> >>> string.split(s, ' ') # Old way
> [
John Machin wrote:
> ... AND it's about time that list is updated to include False explicitly
> -- save nitpicking arguments about whether False is covered by
> "numeric zero of all types" :-)
Done.
>> If I try:
>>
>> f = open("blah.txt", "r")
>> while (c = f.read(1)) != '':
>> #
Shaun wrote:
> Hi,
>
> I'm trying to overload the divide operator in python for basic arithmetic.
> eg. 10/2 ... no classes involved.
>
> I am attempting to redefine operator.__div__ as follows:
>
> # my divide function
> def safediv(a,b):
> return ...
>
> # reassign bui
Yoav wrote:
> Don't think it will do much good. I need to get them from a file and
> extract the last folder in the path. For example:
> if I get "c:\dos\util"
> I want to extract the string "\util"
Then os.path.basename should be for you.
Reinhold
--
http://mail.python.org/mailman/listinfo/py
rafi wrote:
> Adriaan Renting wrote:
>> You might be able to do something along the lines of
>>
>> for count in range(0,maxcount):
>> value = values[count]
>> exec(eval("'a%s=%s' % (count, value)"))
>
> why using the eval?
>
> exec ('a%s=%s' % (count, value))
>
> should be fine
And this de
Michele Simionato wrote:
> An easy question, but I don't find the answer in the docs :-(
> I have a sqlite3 database containing accented characters (latin-1).
> How do I set the right encoding? For instance if I do this:
I think you should ask on the pysqlite-devel list.
Reinhold
--
http://mail.
Hi,
I'm trying to get reportlab working together with the Tahoma font
(by Microsoft ;)
So far it's up and running (converted the ttf with ttf2pt1), but the
Euro sign (which is in position 0x80 in the WinAnsiEncoding) fails to
show up in the final PDF.
I investigated a bit and saw that in the afm
Reinhold Birkenfeld wrote:
> Hi,
>
> I'm trying to get reportlab working together with the Tahoma font
> (by Microsoft ;)
>
> So far it's up and running (converted the ttf with ttf2pt1), but the
> Euro sign (which is in position 0x80 in the WinAnsiEncoding) fail
Bryan Olson wrote:
> Steve Holden wrote:
> > Bryan Olson wrote:
> >> Antoon Pardon wrote:
>
> >> > It probably is too late now, but I always felt, find should
> >> > have returned None when the substring isn't found.
> >>
> >> None is certainly a reasonable candidate.
> [...]
> >> The rea
Terry Hancock wrote:
> On Sunday 28 August 2005 04:47 am, Vaibhav wrote:
>> I recently heard about 'new-style classes'. I am very sorry if this
>> sounds like a newbie question, but what are they? I checked the Python
>> Manual but did not find anything conclusive. Could someone please
>> enlighten
Colin J. Williams wrote:
I recently heard about 'new-style classes'. I am very sorry if this
sounds like a newbie question, but what are they? I checked the Python
Manual but did not find anything conclusive. Could someone please
enlighten me? Thanks!
>>>
>>>"New style" classes are
Bengt Richter wrote:
> On Tue, 30 Aug 2005 12:18:59 GMT, Michael Hudson <[EMAIL PROTECTED]> wrote:
>
>>Talin <[EMAIL PROTECTED]> writes:
>>
>>> I'm finding that a lot of places within my code, I want to return the
>>> output of a generator from another generator. Currently the only
>>> method I kn
Matt Hammond wrote:
>> Well, maybe it's right both ways ;-) I.e., even though yield "is" now
>> an expression, it is valid to use it as an expression-statement which
>> evaluates the expression and discards the value. So I think you could
>> still use the currently illegal "yield in" token sequence
Terry Hancock wrote:
> On Tuesday 30 August 2005 04:09 pm, Reinhold Birkenfeld wrote:
>> The customary way is to use "class new_class(object):". There's no advantage
>> in using
>> __metaclass__ except that you can set it globally for all classes in that
>
Kay Schluehr wrote:
> Reinhold Birkenfeld wrote:
>
>> >x = [ yield r for r in iterable ]
>>
>> Which is quite different from
>>
>> x = (yield) in iterable
>>
>> which is currently (PEP 342) equivalent to
>>
>> _ = (yield)
>
Steve Holden wrote:
> Reinhold Birkenfeld wrote:
>> Terry Hancock wrote:
>>
>>>On Tuesday 30 August 2005 04:09 pm, Reinhold Birkenfeld wrote:
>>>
>>>>The customary way is to use "class new_class(object):". There's no
>>>>
Michael Hoffman wrote:
> Andrew MacKeith wrote:
>> In the C API Docs, the signature of PyBool from long seems to be incorrect.
>>
>> int PyBool_FromLong(long v)
>> Returns Py_True or Py_False depending on the truth value of v. New
>> in version 2.3.
>>
>> The description would suggest:
>>
>
Raymond Hettinger wrote:
> John Machin wrote:
>> Looks like arrays are NOW (2.4.1) pickleable but not unpickleable
>
> Please file a bug report and assign to me.
Done. http://python.org/sf/1281383
Reinhold
--
http://mail.python.org/mailman/listinfo/python-list
tiissa wrote:
> bill wrote:
>>>From 3.2 in the Reference Manual "The Standard Type Hierarchy":
>>
>> "Integers
>> These represent elements from the mathematical set of whole
>> numbers."
>>
>> The generally recognized definition of a 'whole number' is zero and the
>> positive integers.
>
> T
Terry Hancock wrote:
> On Monday 12 September 2005 10:09 pm, [EMAIL PROTECTED] wrote:
>> I like to keep my classes each in a separate file with the same name of
>> the class. The problem with that is that I end up with multiple imports
>> in the beginning of each file, like this:
>>
>> from foo.Ba
Irmen de Jong wrote:
> Michael Hoffman wrote:
>> Lonnie Princehouse wrote:
>>
>>> C:\>python -u
>>> Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
>>> on win32
>>> Type "help", "copyright", "credits" or "license" for more information.
>>>
>> print 'hello'
>>>
>>>
>>> F
n00m wrote:
> Tim Peters wrote:
>> The chance that Raymond Hettinger is going to recode _your_
>> functions in C is approximately 0 ;-)
> Who is Raymond Hettinger?
See python-dev and, wrt this thread,
http://docs.python.org/whatsnew/node12.html.
Reinhold
--
http://mail.python.org/mailman/listin
n00m wrote:
> Got it! He is a kind of pythonic monsters.
>
> Btw, why it's impossible to reply to old threads?
> Namely, there're no more "Reply" link in them.
> Only "Reply to author" etc.
Perhaps because you are not using a real Usenet client?
Reinhold
--
http://mail.python.org/mailman/listin
Robert Kern wrote:
> Grant Edwards wrote:
>> On 2005-09-14, Robert Kern <[EMAIL PROTECTED]> wrote:
>>
>>>Antoon Pardon wrote:
>>
0.0225 isn't representable and it happens that the actual number
you get differ. Now which number python should choose when it is
fed 0.0225, I don't know.
David Wilson wrote:
> For the most part, CPython performs few optimisations by itself. You
> may be interested in psyco, which performs several heavy optimisations
> on running Python code.
>
> http://psyco.sf.net/
>
> Defining a function inside a loop in CPython will cause a new function
> objec
Grant Edwards wrote:
> I give up, how do I make this not fail under 2.4?
>
> fcntl.ioctl(self.dev.fileno(),0xc0047a80,struct.pack("HBB",0x1c,0x00,0x00))
>
> I get an OverflowError: long int too large to convert to int
>
> ioctl() is expecting a 32-bit integer value, and 0xc0047a80 has
> the hi
[EMAIL PROTECTED] wrote:
rs='AUGCUAGACGUGGAGUAG'
rs[12:15]='GAG'
> Traceback (most recent call last):
> File "", line 1, in ?
> rs[12:15]='GAG'
> TypeError: object doesn't support slice assignment
>
> You can't assign to a section of a sliced string in
> Python 2.3 and there doesn'
Florian Lindner wrote:
> Hello,
> is there a python lib (preferably in the std lib) to monitor a directory for
> changes (adding / deleting files) for Linux 2.6?
There isn't, but if you don't want to use dnotify/inotify, it is trivial to
implement: use a timer and check the listdir() return value.
ago wrote:
> Is it possible to have a default value associated python objects? I.e.
> to flag an attribute in such a way that the assignment operator for the
> object returns the default attribute instead of the object itself, but
> calls to other object attributes are properly resolved? (I don't t
Alex Martelli wrote:
> Bill Mill <[EMAIL PROTECTED]> wrote:
>...
>> > > You are modifying the list as you iterate over it. Instead, iterate over
>> > > a copy by using:
>> > >
>> > > for ip in ips[:]:
>...
>> Once you know it, it's neat, and I use it sometimes. However, it's a
>> little too
Xah Lee wrote:
> is it possible to write python code without any indentation?
Yes.
Reinhold
--
http://mail.python.org/mailman/listinfo/python-list
Alex Martelli wrote:
> So, *WHAT ON EARTH* could possibly
> make this weird 'x[:]' form preferable to 'x*1'?! It's MUCH more
> obvious that the second one returns an independent, separate object
> initially equal to x
.>> x = 2
.>> y = x*1
.>> x is y
True
.>>
just-kidding-ly yours,
Reinhold
--
Alex Martelli wrote:
> Reinhold Birkenfeld <[EMAIL PROTECTED]> wrote:
>
>> Alex Martelli wrote:
>>
>> > So, *WHAT ON EARTH* could possibly
>> > make this weird 'x[:]' form preferable to 'x*1'?! It's MUCH more
>&
Fredrik Lundh wrote:
> m" <[EMAIL PROTECTED]> wrote:
>
If Python is better than Perl, I'm curious how really significant
those advantages are ?
>>
>> speedwise, i think perl is faster than python and python performed the
>> slowest as shown in
>> http://www.flat222.org/mac/bench/
>
> if
Walter Burleigh wrote:
> Erik Johnson wrote:
>
>> There are a lot of things about PHP I was not too keen on and hence
>> why
>> my company is primarily doing Python these days, but one thing I was quite
>> impressed with was the ease with which it provided session
>> functionality...
>
>
Xah Lee wrote:
> here's the answer to the partition by equivalence exercise.
Your Python solution is, as expected, wrong (try with
[[10, 8], [7, 3], [1, 7], [5, 4], [2, 2], [3, 8], [7, 10], [2, 3], [6,
10], [3, 2]]
for example).
The solution by John Lenton is wrong, too.
The solution by Brian Be
Reinhold Birkenfeld wrote:
> My solution (which may not be the fastest or most effective, but till
> now is the shortest and it works):
>
> def merge(pairings):
> sets = {}
> for x1, x2 in pairings:
> newset = (sets.get(x1, frozenset([x1]))
>
John Machin wrote:
> Reinhold Birkenfeld wrote:
>> Reinhold Birkenfeld wrote:
>>
>> > My solution (which may not be the fastest or most effective, but
> till
>> > now is the shortest and it works):
>
> [snip RB]
>>
>> A recursive solution (
Xah Lee wrote:
> is there a way to write a expression of a function with more than 1
> argument?
>
> e.g., i want a expression that's equivalent to
>
> def f(x,y)
> return x+y
Looking for lambda?
Reinhold
--
http://mail.python.org/mailman/listinfo/python-list
David M. Cooke wrote:
> Simon Wittber <[EMAIL PROTECTED]> writes:
>
>>> You mean like 'import'? :)
>>
>> That's how I would do it. It's the simplest thing, that works.
>>
>> exec("import %s as plugin" % pluginName)
>> plugin.someMethod()
>>
>> where pluginName is the name of the python file, minus
Doug Schwarz wrote:
> Dave,
>
> I think eval might be what you're looking for:
>
> f = eval('len')
> length = f([1,2,3])
But only if the string given to eval is checked thorougly for allowed
contents. Better use getattr.
Reinhold
--
http://mail.python.org/mailman/listinfo/python-list
Doug Schwarz wrote:
>> > Dave,
>> >
>> > I think eval might be what you're looking for:
>> >
>> > f = eval('len')
>> > length = f([1,2,3])
>>
>> But only if the string given to eval is checked thorougly for allowed
>> contents. Better use getattr.
>
> Actually, upon reading Peter Hansen's repl
Xah Lee wrote:
> is it possible in Python to create a function that maintains a variable
> value?
>
> something like this:
>
> globe=0;
> def myFun():
> globe=globe+1
> return globe
You could work with function attributes:
def myFun():
try:myFun.globe += 1
except: myFun.globe =
Michael Hoffman wrote:
> Joe wrote:
>
>> Are there any differences between that and the actual interactve prompt that
>> I should be aware of?
>
> I don't know, unfortunately.
>
>> Would you consider that a better method than using (thanks to those who
>> suggested this other option):
>>
>> i
Reinhold Birkenfeld wrote:
> or with a default function argument:
>
>
> class Dummy: pass
>
> def myFun(globe=Dummy()):
> try:globe.globe += 1
> except: globe.globe = 1
>
> return globe.globe
A quicker way:
def myFun(globe=[0]):
gl
Dave Opstad wrote:
> In this snippet:
>
> d = {'x': 1}
> value = d.get('x', bigscaryfunction())
>
> the bigscaryfunction is always called, even though 'x' is a valid key.
> Is there a "short-circuit" version of get that doesn't evaluate the
> second argument if the first is a valid key? For now
Steven Bethard wrote:
> Chris Perkins wrote:
>> Random idea of the day: How about having syntax support for
>> currying/partial function application, like this:
>>
>> func(..., a, b)
>> func(a, ..., b)
>> func(a, b, ...)
>>
>> That is:
>> 1) Make an Ellipsis literal legal syntax in an argument li
Jeff Shannon wrote:
> 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 r
Bill Mill wrote:
> On Tue, 15 Mar 2005 10:47:28 -0800, James Stroud <[EMAIL PROTECTED]> wrote:
>> On Tuesday 15 March 2005 08:25 am, Roy Smith wrote:
>> > a = () # tuple of zero elements
>> > a = (1,) # tuple of one element
>> > a = 1, # tuple of one element
>> > a = (1) # scal
Raymond Hettinger wrote:
> [Michele Simionato]
>> +1 for inc instead of count.
>
> Any takers for tally()?
Well, as a non-native speaker, I had to look up this one in my
dictionary. That said, it may be bad luck on my side, but it may be that
this word is relatively uncommon and there are many ot
Peter Hansen wrote:
> Michele Simionato wrote:
>> +1 for inc instead of count.
>
> -1 for inc, increment, or anything that carries a
> connotation of *increasing* the value, so long as
> the proposal allows for negative numbers to be
> involved. "Incrementing by -1" is a pretty silly
> picture.
>
MackS wrote:
> Hi
>
> I'm new to Python, I've read the FAQ but still can't get the following
> simple example working:
>
> # file main_mod.py:
>
> global_string = 'abc'
>
> def main():
>
> import auxiliary_mod
> instance = auxiliary_mod.ClassA()
> instance.fun()
> return
>
> m
John Machin wrote:
> Raymond Hettinger wrote:
>> I would like to get everyone's thoughts on two new dictionary
> methods:
>
> +1 for each.
>
>> PROBLEMS BEING SOLVED
>> -
>>
>> The readability issues with the existing constructs are:
>>
>> * They are awkward to teach, create,
Mike Rovner wrote:
> Paul Rubin wrote:
>
>> If the compiler can do some type inference, it can optimize out those
>> multiple calls pretty straightforwardly.
>
> It can be tipped like that:
>
> di = dict(int)
> di.setdefault(0)
> di[key] += 1
Interesting, but why do you need to give the int typ
John Machin wrote:
> Reinhold Birkenfeld wrote:
>> John Machin wrote:
>> Are you kidding? If you know what "set" and "default" means, you will
> be
>> able to guess what "setdefault" means. Same goes for updateBy.
>>
>
> No I'
George Sakkis wrote:
>> -1 form me.
>>
>> I'm not very glad with both of them ( not a naming issue ) because i
>> think that the dict type should offer only methods that apply to each
>> dict whatever it contains. count() specializes to dict values that are
>> addable and appendlist to those that a
Tian wrote:
> I am python beginner, I have a question about the interdependence of
> modules.
>
> For example, when I have two modules:
>
> module1.py
> -
> def plus(x):
> return add(x,1)
>
>
> module2.py
> -
> def add(x,y):
> return x+y
>
> def plus2(x):
> return
holger krekel wrote:
> Hi George,
>
> [george young Fri, Dec 10, 2004 at 10:45:47AM -0500]
>> [python 2.3.3, x86 linux]
>> I recently found myself writing something like:
>>
>> def get_connection():
>> if tcp_conn():
>> if server_allows_conn():
>> return 'good_conn'
>>
Jon wrote:
> Hi Jeff,
>
> That makes sense -- thanks. However now when I use "re.capwords (sentence)"
> I get a different error message:
>
> AttributeError: 'module' object has no attribute 'capwords'
>
> Each of the other two suggested implimentations produce a similar error
> message. Is the
Peter Otten wrote:
> Terry Reedy wrote:
>
>> 'separate' (se-parate == take a-part) and its derivatives are perhaps the
>> most frequently misspelled English word on clp. Seems to be 'par' for the
>> course. It has 2 e's bracketing 2 a's. It derives from the Latin
>> 'parare', as does pare, so '
Peter Otten wrote:
> Reinhold Birkenfeld wrote:
>
>>> the web: 4%
>>> python: 9%
>>> slashdot: 26%
>>> perl: 29% *
>>
>> How did you get these data points?
>
> I copied the numbers from these pages:
>
> http://www.
Doug Holton wrote:
> Hans Nowak wrote:
>>> Quote:
>>> "this is comp.lang.python, not comp.lang.boo."
>>
>>
>> Which is obviously not the same as "Boo should not be mentioned on this
>> newsgroup".
>
> I used the exact same phrase in another note except using the term
> "logo" instead of "boo
Reinhold Birkenfeld wrote:
> Peter Otten wrote:
>> Reinhold Birkenfeld wrote:
>>
>>>> the web: 4%
>>>> python: 9%
>>>> slashdot: 26%
>>>> perl: 29% *
>>>
>>> How did you get these data points?
>>
>>
Doug Holton wrote:
> Peter Hansen wrote:
>> Luis M. Gonzalez wrote:
>>
>>> As far as I could see, everythime the word "boo" is typed, some sort of
>>> censorship or plain bashing comes up, and I think this is not fair.
>>
>> I think doing this by defending Doug's postings, however, might weaken
>>
Roy Smith wrote:
> "John Roth" <[EMAIL PROTECTED]> wrote:
>> > If Python had originally been invented in a unicode world, I suppose we
>> > wouldn't have this problem. We'd just be using guillemots for tuples
>> > (and have keyboards which made it easy to type them).
>>
>> I suppose the forces of
Grant Edwards wrote:
> On 2004-12-29, Reinhold Birkenfeld <[EMAIL PROTECTED]> wrote:
>
>> Perl6 experiments with the use of guillemots as part of the syntax.
>
> As if Perl didn't look like bird-tracks already...
>
> http://www.seabird.org/educ
Alex Martelli wrote:
> Jeff Shannon <[EMAIL PROTECTED]> wrote:
>...
>> to remember and type some arcane alt-keycode formula to be able to do
>> basic scripting would be obnoxious, to say the least. Most keyboards
>> worldwide provide decent support for the ASCII character set (though
>> some
101 - 200 of 252 matches
Mail list logo