Hi,
for some of the "ground work" you could use the Python Web Modules
(www.pythonweb.org).
fs
--
http://mail.python.org/mailman/listinfo/python-list
I have been looking at the Python re module and have been trying to
make sense of a simple function that I'd like to do. However, no amount
of reading or googling has helped me with this. Forgive my
stone-headedness. I have done this with .NET and Java in the past but
damn if I can't get it done wi
Michael Hudson wrote:
> Michael Hudson <[EMAIL PROTECTED]> writes:
>
>>Robert Kern <[EMAIL PROTECTED]> writes:
>>
>>>What I'm trying to say is that posting to c.l.py is absolutely
>>>ineffective in achieving that goal. Code attracts people that like
>>>to code. Tedious, repetitive c.l.py threads a
Hi,
I have Python embedded with my other code, and when my other code opens
a console and redirects stdout, stdin and stderr to it, then calls
PyRun_InteractiveLoop, it immediately returns with an EOF.
After some debugging the reason for this appears to be that the stdin
and stdout that the ReadL
Hi,
I have a list that contains nodes from a tree. Each node is a class
instance, but I'll use dictionary here to simplify the example.
So the list looks like this:
[
{'id': 1,
'name': 'Parent node',
'ord_number': 1,
'parent_id': 0,
'url': '/parentnode/'},
{'id': 2,
'name': 'My node',
'ord_number'
J wrote:
> I have looked at some of the source code in PyObject_GenericGetAttr and
> it turns out that the object has no dictionary. It seens that the
> address of the dictionary is computed somehow via tp_dictoffset in the
> type object.
I asked this a few months ago..
Basically, you need a
Jeremy Moles wrote:
> Or, perhaps, there's even a better way? I'm getting more and more
> experienced with the Python/C API, so I don't need a walk-through or
> anything. :) Just an experienced recommendation...
>
Better by far to create a new python type in C that has your struct
inside it and
Gregory Bond wrote:
> Make sure you init this member to 0 (tp_init), and make sure you
> PyXDECREF() it when the object is deleted (tp_dealloc).
As this may cause your objects to appear in cycles, you may also
have to add support for cyclic GC (unless you already did this
before, and unless you ca
Harlin Seritt wrote:
> I have been looking at the Python re module and have been trying to
> make sense of a simple function that I'd like to do. However, no amount
> of reading or googling has helped me with this. Forgive my
> stone-headedness. I have done this with .NET and Java in the past but
>
Robert Kern <[EMAIL PROTECTED]>
> Michael Hudson wrote:
> > Michael Hudson <[EMAIL PROTECTED]> writes:
> >
> >>Robert Kern <[EMAIL PROTECTED]> writes:
> >>
> >>>What I'm trying to say is that posting to c.l.py is absolutely
> >>>ineffective in achieving that goal. Code attracts people that like
>
Ksenia Marasanova wrote:
> Hi,
>
> I have a list that contains nodes from a tree. Each node is a class
> instance, but I'll use dictionary here to simplify the example.
> So the list looks like this:
> [
> {'id': 1,
> 'name': 'Parent node',
> 'ord_number': 1,
> 'parent_id': 0,
> 'url': '/parentnod
Thanks very much for your helpful replies.
I totally accept my C++/Java background is a lot of this, and I need to
make the shift to Python's way of thinking.
As for multiple inheritance, yes I've always been aware of it being
available in C++, but I learned C++ at a company which banned multiple
Thanks very much for your helpful replies.
I totally accept my C++/Java background is a lot of this, and I need to
make the shift to Python's way of thinking.
As for multiple inheritance, yes I've always been aware of it being
available in C++, but I learned C++ at a company which banned multiple
> Functions existing in a module? Surely if "everything is an object" (OK
> thats Java-talk but supposedly Python will eventually follow this too)
> then there should be nothing in a module thats not part of a class.
No, it's a bit the other way around. In Python, functions are objects:
>>> d
Reinhold Birkenfeld <[EMAIL PROTECTED]> writes:
> 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.
Scott David Daniels wrote:
> Well, an entry in the dictionary "sys.modules" is what is returned by
> imports, so you could either pre-replace or post-replace a module by
> an object which uses the descriptor technique to get to some (but not
> necessarily all) of the attributes. Think of this tec
If input is ['red','blue'],
list1 is [ {'primarycolor':'red', 'secondarycolor':'burgundee'},
{'primarycolor':'red', 'secondarycolor':'wine'},
{'primarycolor':'yellow','secondarycolor':'plain'},
{'primarycolor':'blue','secondarycolor':'ocean'}]
I
N.Davis wrote:
> Functions existing in a module? Surely if "everything is an object" (OK
> thats Java-talk but supposedly Python will eventually follow this too)
> then there should be nothing in a module thats not part of a class.
Well, all data in a Python program are objects, in the sense tha
Bengt Richter wrote:
> Another thought/bf would be a way to extend the attribute namespace of an
> arbitrary object
> by chaining the attribute name spaces of a sequence of objects (this would be
> a language mod)
> e.g., (sort of a dynamic instance attribute mixin)
>
> obj ..= a, b, c #
> class Node:
> def __init__(self, name, url, order, pid, id):
> self.name = name
> self.url = url
> self.order = order
> self.pid = pid
> self.id = id
> def __repr__(self):
> return self
> I want to search list1, and the result should be all dictionaries where
> primarycolor is in input. I can do this using a double for-loop, but is
> there a more efficent way?
Of course.:-)
L = [dict for dict in list1 if dict['primarycolor'] in input]
In older versions of Python, we would u
Hi Bryan,
Thanks for your reply.
I tried to test your solution, but it doesn't work, hence
threading.Semaphore object hasn't method to get value of semaphore.
I looked to source code of semaphore.py and find out that value is private
variable.
Best regards,
/Gelios
"Bryan Olson" <[EMAIL PRO
Example of the wrong sort:
class Node:
def __init__(self, name, url, order, pid, id):
self.name = name
self.url = url
self.order = order
self.pid = pid
self.id = id
def __repr__(self):
return '%s [order: %s]' % (self.url, self.order)
def
Ksenia Marasanova wrote:
> I want to sort this list with the following rules:
> 1. The parent must always come before the children in the list
> 2. Nodes with the same parent must be sorted by 'ord_number'
>
> The first rule is easy, cause I can use 'url' for it. List with nodes
> is coming from
Harlin Seritt wrote:
> I am trying to find some matches and have them put into a list when
> processing is done. I'll use a simple example like email addresses.
>
> My input is the following:
> wordList = ['myname1', '[EMAIL PROTECTED]', '[EMAIL PROTECTED]',
> '[EMAIL PROTECTED]', '[EMAIL PROTECTE
Hi everyone,
I have a problem with initialization.
>>> a, b = [[]]*2
>>> a.append(1)
>>> b
[1]
Why is this? Why does not this behave like the below:
>>> a, b = [[], []]
>>> a.append(1)
>>> b
[]
And, just to add to my confusion:
>>> [[]]*2
[[], []]
>>> [[], []] == [[]]*2
True
Thanks in advance
hi
I'm learning python since 3 days. I' ve some programming experience in
BASIC, Pascal, C, C++ and Java. Actually I want to add a scripting
language to this repertoire (I have virtually no experience with
scripting).
Having read that python is object orientated, I start wondering if
python i
Robert Wierschke ha scritto:
...
Reading the FAQ at the python website too difficult? I don't think you
missed any of the most frequently asked... Good job.
--
Adriano Varoli Piazza
The Inside Out: http://moranar.com.ar
MSN: [EMAIL PROTECTED]
ICQ: 4410132
--
http://mail.python.org/mailman/listi
Jiri Barton wrote:
> Hi everyone,
>
> I have a problem with initialization.
>
a, b = [[]]*2
a.append(1)
b
> [1]
>
> Why is this? Why does not this behave like the below:
>
>>> a, b = [[]]*2
>>> a==b
True
>
> And, just to add to my confusion:
>
>
[[]]*2
>
> [[], []]
>
>>>
Tito wrote:
>N.Davis wrote:
>
>
>>Functions existing in a module? Surely if "everything is an object" (OK
>>thats Java-talk but supposedly Python will eventually follow this too)
>>then there should be nothing in a module thats not part of a class.
>>
>>
>
>Well, all data in a Python progr
Ahh that's it Frederik. That's what I was looking for. The regular
expression problems I will take care of, but first wanted to walk
before running. ;)
Thanks,
Harlin Seritt
--
http://mail.python.org/mailman/listinfo/python-list
Hi Jiri,
On Wed, 10 Aug 2005 11:40:54 +0100, Jiri Barton <[EMAIL PROTECTED]> wrote:
> I have a problem with initialization.
a, b = [[]]*2
a.append(1)
b
> [1]
>
> Why is this? Why does not this behave like the below:
>
a, b = [[], []]
a.append(1)
b
> []
In the first
Evil Bastard wrote:
> Peter Hansen wrote:
>>grabbing
>>an off the shelf Forth might be a more productive use of your time.
>
> Heh, methinks one might be misunderstanding the Forth culture.
Lacking entirely in any knowledge of it whatsoever would be a more
accurate description. "Ignorant of" is
Forgive another question here, but what is the 'r' for when used with
expression: r'\w+...' ?
--
http://mail.python.org/mailman/listinfo/python-list
Ben Finney wrote:
> Roy Smith <[EMAIL PROTECTED]> wrote:
>
>>I've got a directory where I keep all sorts of little snippets of
>>python code for testing. When I start up python in that directory,
>>I get the error I reported. It turns out, I've got a file called
>>"string.py" in it [...]
>>
>>so
Paolino wrote:
> Jiri Barton wrote:
>
>>Hi everyone,
>>
>>I have a problem with initialization.
>>
>>
>a, b = [[]]*2
>a.append(1)
>b
>>
>>[1]
>>
>>Why is this? Why does not this behave like the below:
>>
>
> >>> a, b = [[]]*2
> >>> a==b
> True
Ooops I should write 'a is b'
>
>
>>A
I had future investigation and as I understand in POSIX compliant threads,
getting value of semaphore should be exist.
As the matter of fact Python threads is not fully POSIX compliant. Pitty!
Contining looking for another solution.
"Nodir Gulyamov" <[EMAIL PROTECTED]> wrote in message
news:[EMA
Tried to rewrite using Event() just as experiment, but unfortunately
MainThread will blocking all others.
Code below:
import threading
class class1:
def __init__(self):
self.myEvent = threading.Event()
result = doSomeJob()
def increaseCounter(self):
self.myEvent.
Dan wrote:
> You might think of modules in Python as like packages in Java. However,
> putting classes in the same module doesn't give them any additional
> powers to interact with each other. (At least, not that I know of.)
Use of "global" to rebind shared module-scope names...
-Peter
--
http:/
Adriano Varoli Piazza schrieb:
> Robert Wierschke ha scritto:
> ...
> Reading the FAQ at the python website too difficult? I don't think you
> missed any of the most frequently asked... Good job.
>
sorry I 've forgetten the FAQ
--
http://mail.python.org/mailman/listinfo/python-list
Bryan Olson wrote:
> Here's a module to show stderr output from console-less Python
> apps, and stay out of the way otherwise. I plan to make a ASPN
> recipe of it, but I thought I'd run it by this group first.
For what it's worth, I believe you've basically duplicated the
functionality available
Robert Wierschke wrote:
> Having read that python is object orientated, I start wondering if
> python is the right choice and what it is...
>
> a scripting language or a "normal" language like C++ etc.
Ignore the "scripting language" label and just treat Python as a general
purpose "normal"
Harlin Seritt wrote:
> Forgive another question here, but what is the 'r' for when used with
> expression: r'\w+...' ?
r'..' or r".." are "raw strings" where backslashes do not introduce an
escape sequence - so you don't have to write '\\', if you need a backslash
in the string, e.g. r'\w+' == '\
Yes, now it is clear!
As always, I should have RTFM, the operator* is not just a syntactic sugar
and thus does not make copies. You know, my actual scenario was with four
variables at the time:
a, b, c, d = [], [], [], []
so I was even more tempted to use the previous and wrong approach:-)
Than
Robert Wierschke <[EMAIL PROTECTED]> wrote:
> a scripting language or a "normal" language like C++ etc.
It is difficult to define exactly what a "scripting language" is and isn't,
but I think most people would classify it as a scripting language.
> So please tell me what python is, what ar
[EMAIL PROTECTED] wrote:
> additive = self.additive,
> ^
> SyntaxError: invalid syntax
>
I'm using Windows XP and Python 2.4.1
>
> Any ideas? O:-)
I had a similar problem with python 2.4.1.
When I imported some module, I got a Sy
[EMAIL PROTECTED] wrote:
> I was wondering if anyone could make recomendations/comments about CVS
> systems, their experiences and what perhaps the strengths of each.
>
> Currently we have 2 developers but expect to grow to perhaps 5.
>
> Most of the developement is Python, but some C, Javascrip
It has no __iter__ method either. I guess 'next' is just a historical
accident.
Should be easy enough to wrap it in your own class though and resolve
this ?
Regards,
Fuzzy
http://www.voidspace.org.uk/python
--
http://mail.python.org/mailman/listinfo/python-list
2005/8/10, Peter Otten <[EMAIL PROTECTED]>:
> I think you cannot get away with your first rule, but have to operate on the
> full path instead. Otherwise the position of inner nodes would sometimes be
> determined by their url and sometimes by their ord_number *during* *the*
> *same* *sort*.
Rrr.
Paolino wrote:
> This confuses me also, looks like empty lists share same object.
nope. see Matt Hammonds reply for the full story.
--
http://mail.python.org/mailman/listinfo/python-list
Thanks so much for this. It is exactly what I was looking for.
If I am simply reading the bytes from disk, would I still need to
convert the these values HEX characters first with Hexlify, or is there
a more direct route ?
ie. convert them to the double float directly from the byte values ?
--
Tim Peters wrote:
> Because the program is buggy: synchronizing threads isn't a "do it if
> you feel like it" thing, it's essential to correct threaded behavior.
> If you're going to show students bad thread practice, they're going to
> get mysteries a lot deeper and more damaging than this one <0
For the sake of completeness (I didn't copy this message to the list):
> I have a problem with initialization.
> >>> a, b = [[]]*2
> >>> a.append(1)
> >>> b
> [1]
>
> Why is this? Why does not this behave like the below:
You create a single list (inside your brachets) and duplicate a
reference to
Lots and lots of people want ordered dicts it seems. Or at least, they want to be able to access their dictionary keys in order. It's in the FAQ (
http://www.python.org/doc/faq/programming.html#how-can-i-get-a-dictionary-to-display-its-keys-in-a-consistent-order) and has recently shown up as a re
> return [(node.id, node.ord_number) for node in self.get_path()]
I meant:
> return [(node.ord_number, node.id) for node in self.get_path()]
--
Ksenia
--
http://mail.python.org/mailman/listinfo/python-list
Peter Hansen wrote:
> Bryan Olson wrote:
>
>> Here's a module to show stderr output from console-less Python
>> apps, and stay out of the way otherwise. I plan to make a ASPN
>> recipe of it, but I thought I'd run it by this group first.
>
> For what it's worth, I believe you've basically du
> Lots and lots of people want ordered dicts it seems. Or at least, they
> want
> to be able to access their dictionary keys in order.
> [snipped lots of examples, nice pro-con lists, etc.]
> What do y'all think?
I'll second the need for this. Although, what can also be useful as a
further extens
Nodir Gulyamov wrote:
> Hi Bryan,
> Thanks for your reply.
> I tried to test your solution, but it doesn't work, hence
> threading.Semaphore object hasn't method to get value of semaphore.
> I looked to source code of semaphore.py and find out that value is
private
> variable.
Your code
Does someone know if the module pytz
(http://sourceforge.net/projects/pytz/) is thread-safe ?
I have not seen it explicitely stated, and just wanted to be sure, as I
want to use it.
That's because in the file pytz/tzinfo.py, I see global variables
_timedelta_cache, _datetime_cache, _ttinfo_cache,
Nodir Gulyamov wrote:
> Tried to rewrite using Event() just as experiment, but unfortunately
> MainThread will blocking all others.
> Code below:
>
> import threading
>
> class class1:
> def __init__(self):
> self.myEvent = threading.Event()
> result = doSomeJob()
>
Dan <[EMAIL PROTECTED]> wrote:
>> [ someone else wrote: ]
>> I want to search list1, and the result should be all dictionaries where
>> primarycolor is in input. I can do this using a double for-loop, but is
>> there a more efficent way?
>
>Of course.:-)
>
>L = [dict for dict in list1 if dict[
infidel <[EMAIL PROTECTED]> wrote:
>> [ somebody else wrote: ]
>> To my mind, although one CAN put many classes in a file, it is better to
>> put one class per file, for readability and maintainability.
>Personally I find it easier to maintain a set of related classes when
>they're all in the same
On 10 Aug 2005 05:30:37 -0700, [EMAIL PROTECTED] wrote:
>Thanks so much for this. It is exactly what I was looking for.
>
>If I am simply reading the bytes from disk, would I still need to
>convert the these values HEX characters first with Hexlify, or is there
>a more direct route ?
>ie. convert
Jiri Barton wrote:
> Yes, now it is clear!
>
> As always, I should have RTFM, the operator* is not just a syntactic
sugar
> and thus does not make copies.
That issue bites, like, everyone.
> You know, my actual scenario was with four
> variables at the time:
>
> a, b, c, d = [], [], [],
If your re demands get more complicated, you could take a look at
pyparsing. The code is a bit more verbose, but many find it easier to
compose their expressions using pyparsing's classes, such as Literal,
OneOrMore, Optional, etc., plus a number of built-in helper functions
and expressions, inclu
On 2005-08-10, Bengt Richter <[EMAIL PROTECTED]> wrote:
> On Tue, 09 Aug 2005 21:50:06 -, Grant Edwards <[EMAIL PROTECTED]> wrote:
>
>>On 2005-08-09, Scott David Daniels <[EMAIL PROTECTED]> wrote:
>>> Grant Edwards wrote:
>Ex #1) 333-
>Hex On disk: 00 00 00 80 6a 6e 49 41
>
>>
On 2005-08-10, John Machin <[EMAIL PROTECTED]> wrote:
Perhaps the one bit is an exponent -- some kind of floating point
based format? That matches the doubling of all digits.
>>>
>>>That would just be sick. I can't imagine anybody on an 8-bit
>>>CPU using FP for a phone number.
>> >>>
Hi,
Thanks your reply again. Please find my comments below.
> Your code did not, and could not, use the value of counter for
> anything but busy-waiting. You had:
>
> while counter != 1:
> pass
> # ... continue...
>
> If you replace this with the semaphore, you can
On 8/10/05, Chris Cioffi <[EMAIL PROTECTED]> wrote:
> I have lots of code that looks like:
> keys = mydict.keys()
> keys.sort()
keys = sorted(mydict.keys())
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/pyt
nicolas_riesch wrote:
> Does someone know if the module pytz
> (http://sourceforge.net/projects/pytz/) is thread-safe ?
On that, I don't know.
> That's because in the file pytz/tzinfo.py, I see global variables
> _timedelta_cache, _datetime_cache, _ttinfo_cache, which are
> dictionnaries and
Hi again, comments below:
> > doSomeJob(self):
> > # BLOCKING HERE ###
> > if not self.myEvent.isSet():
> > self.myEvent.wait()
>
> The initial 'if' is superflous.
Excuse me, please explain.
> > self.myEvent.clear()
> > # ... continue...
> >
>
Anybody have an idea for how to do python mixins that don't down-call?
Thanks
(
Mixins from different vendors might use the same method names for unrelated
features, but should continue to work sensibly.
It's fine to have one mixin method override another in its "public" interface,
but overridin
I have a self organizing net which aim is clustering words.
Let's think the clustering is about their 2-grams set.
Words then are instances of this class.
class clusterable(str):
def __abs__(self):# the set of q-grams (to be calculated only once)
return set([(self+self[0])[n:n+2] for n in
Hey I'm a programmer looking to port some of my opengl ...although
limited into a python app I've made... I'd like to know where to find
any python/opengl source or a tutorial etc.. whatever I'd like to get a
series of points that represent a 3d slope presented to the user.
Thanks
Matt
--
http:/
nicolas_riesch wrote:
> Does someone know if the module pytz
> (http://sourceforge.net/projects/pytz/) is thread-safe ?
> I have not seen it explicitely stated, and just wanted to be sure, as I
> want to use it.
>
> That's because in the file pytz/tzinfo.py, I see global variables
> _timedelta_cac
Nodir Gulyamov wrote:
> Hi again, comments below:
>
>
>>>doSomeJob(self):
>>># BLOCKING HERE ###
>>>if not self.myEvent.isSet():
>>>self.myEvent.wait()
>>
>>The initial 'if' is superflous.
>
> Excuse me, please explain.
The code:
if some_event.i
> Hey I'm a programmer looking to port some of my opengl ...although
> limited into a python app I've made... I'd like to know where to find
> any python/opengl source or a tutorial etc.. whatever I'd like to get a
> series of points that represent a 3d slope presented to the user.
Try wxPython.
-
On 10/08/05, Simon Brunning <[EMAIL PROTECTED]> wrote:
On 8/10/05, Chris Cioffi <[EMAIL PROTECTED]> wrote:
> I have lots of code that looks like:> keys = mydict.keys()> keys.sort()keys = sorted(mydict.keys())
While the sorted() built in addressed (yet another) community desire, I don't th
Hi,
I have several files to download and a GUI to update. I know this is a
frequently asked question but i can't find an appropriate solution.
My Downloader extends threading.Thread and update a wx.Gauge in GUI
during the process.
for src in urls:
downloader = Downloader( src, destination,
On 8/10/05, Chris Cioffi <[EMAIL PROTECTED]> wrote:
> While the sorted() built in addressed (yet another) community desire, I
> don't think this addresses the underlying expectation of getting dictionary
> keys in some order.
You do get them in *some* order. ;-)
> It works, but it feel like a
[EMAIL PROTECTED] wrote:
> > Lots and lots of people want ordered dicts it seems. Or at least, they
> > want
> > to be able to access their dictionary keys in order.
> > [snipped lots of examples, nice pro-con lists, etc.]
> > What do y'all think?
>
> I'll second the need for this. Although, what
I am looking for a pure Python secure ftp solution.
Does it exist?
I would have thought that the existence of OpenSSL
would imply "yes" but I cannot find anything.
ftplib does not seem to provide any secure services.
I know about fptutil
http://codespeak.net/mailman/listinfo/ftputil
but that doe
Harlin Seritt wrote:
> I am trying to find some matches and have them put into a list when
> processing is done. I'll use a simple example like email addresses.
>
> My input is the following:
> wordList = ['myname1', '[EMAIL PROTECTED]', '[EMAIL PROTECTED]',
> '[EMAIL PROTECTED]', '[EMAIL PROTECT
The Python slice type has one method 'indices', and reportedly:
This method takes a single integer argument /length/ and
computes information about the extended slice that the slice
object would describe if applied to a sequence of length
items. It returns a tuple of three int
Hello all,
What is the proper way to document a class in Python? I have written
a few python libraries that I would like to document.
I'm doing a lot of this:
class Foo(object):
"""
This is a class which blah, blah, blah... It's features are blah,
blah, blah...
"""
def addStuf
In article <[EMAIL PROTECTED]>,
Erik Max Francis <[EMAIL PROTECTED]> wrote:
>
>It also is free for personal use (up to 2 clients, 2 users) and open
>soruce projects can get free licenses. Or at least it was so the last I
>checked.
For anything mission-critical, I wouldn't want to rely on a fre
The standard pydoc module is very useful. A simple example of how you
could use it:
>>> import pydoc
>>> mymodule = pydoc.importfile(r"C:\My Py\my_foo.py")
>>> html = pydoc.html.page(pydoc.describe(mymodule),
>>> pydoc.html.document(mymodule))
>>> open("foo.html", "w").write(html)
Then you have
Thanks again.
Sort of thru me off, but is working perfectly now.
--
http://mail.python.org/mailman/listinfo/python-list
In article <[EMAIL PROTECTED]>,
Neal Becker <[EMAIL PROTECTED]> wrote:
>
>For a python newsgroup, you are required to consider mercurial. It's not
>ready for production use yet, but is making rapid progress, and many
>(including myself) are using it.
Why do you say "required" when the next sente
On Wed, 10 Aug 2005 12:40:54 +0200, Jiri Barton <[EMAIL PROTECTED]> wrote:
>Hi everyone,
>
>I have a problem with initialization.
a, b = [[]]*2
a.append(1)
b
>[1]
>
>Why is this? Why does not this behave like the below:
>
a, b = [[], []]
a.append(1)
b
>[]
In your 1st
On Wed, 10 Aug 2005 13:14:26 +0200, Robert Wierschke <[EMAIL PROTECTED]> wrote:
>hi
>
>I'm learning python since 3 days. I' ve some programming experience in
>BASIC, Pascal, C, C++ and Java. Actually I want to add a scripting
>language to this repertoire (I have virtually no experience with
>scr
In article <[EMAIL PROTECTED]>,
Terry Reedy <[EMAIL PROTECTED]> wrote:
>"Jeffrey E. Forcier" <[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]
>>
>> Thirding the Subversion/SVN suggestions. It's generally a newer, better
>> CVS with some new features and a lot less of the negative featu
Simon Brunning wrote:
> On 8/10/05, Chris Cioffi <[EMAIL PROTECTED]> wrote:
>
>>I have lots of code that looks like:
>>keys = mydict.keys()
>>keys.sort()
>
>
> keys = sorted(mydict.keys())
>
Or (often useful to get at contents):
items = sorted(mydict.items())
as in:
For k
N.Davis wrote:
(snip)
> Functions existing in a module? Surely if "everything is an object" (OK
> thats Java-talk but supposedly Python will eventually follow this too)
> then there should be nothing in a module thats not part of a class.
Why ? The name of the paradigm is *object* oriented, not *c
Hi there,
I'm pretty new to Python and am trying to figure out how to get "will
this code compile?"-like code checking. To me this is a pretty basic
language/environment requirement, especially when working with large
projects. It is *much* better to catch errors at "compile-time" rather
than at
Neil Benn wrote:
(snip)
> If you don't have a class how can you combine functionality with data
> and hold state
In Python, functions can hold state in various ways: closures,
generators, and - Python functions being instances of the function class
- attributes.
> - that is one of the points of
Peter Hansen wrote:
> (Not trying to argue, just understand, because it looks like you're
> conflating Forth programs with Forth implementations, or perhaps I'm
> even more ignorant than noted above and am missing a key point. :-)
It's decades since I coded Forth, but I suspect that Forth compil
Get epydoc from SourceForge (http://epydoc.sourceforge.net/). It will
auto-generate beautiful HTML doc pages for your Python classes, using
the information you have inserted as the doc strings for your classes
and methods. I use it to generate the pyparsing documentation, and it
works very well f
Roy Smith wrote:
> Andy Leszczynski writes:
>
(snip)
>>It's not a true statement. Nothing in the language enforces LSP. In
>>fact, there's not even a [way?] when a function/method is invoked to make
>>sure the type passed in is a subtype of the type you expect
>
>
> Well, that's not entirely t
Why is it not possible to get the frame from the interpreter using the
inspect library? IOW, why does this code:
>>> from inspect import *
>>> stack()
produce:
[(, '', 1, '?', None, None)]
instead of:
[(, '', 1, '?', '\tstack()', 0)]
?
I must be missing something. The motivating question is:
1 - 100 of 205 matches
Mail list logo