The next meeting of BayPIGgies will be Thurs, July 14 at 7:30pm at
Google, building 40, room Temp Tech Talk.
Alex Martelli will be doing his Black Magic talk on descriptors,
decorators, and metaclasses. Prepare to have your head exploded!
BayPIGgies meetings alternate between IronPort (San
Kay Schluehr wrote:
Dan Sommers schrieb:
How about this:
def __init__(self, self.x, y, self.z):
# self.x, self.z from first and third explicit parameters
do_something_with_y()
Can you tell me in which way it is anyhow better than the original
proposal
def
Hello All,
Is there a way to import module as __main__?
Say hw.py is:
if __name__ == __main__:
print Hello
And the C code is (error handling omitted):
int
main(int argc, char *argv[])
{
Py_Initialize();
PySys_SetArgv(argc, argv);
atexit(Py_Finalize);
Paul Bilnoski wrote:
The barbar generals will just grunt while the French generals
will inspire with some poetic invocation.
For auction:
One authentic French army-issued rifle. Only dropped once.
What has that got to do with the king of the elephants?
--
If you want to post a followup
On Friday 08 July 2005 01:31 pm, gov wrote:
Where I work, we receive large quantities of data which is currently
all printed on large, obsolete, dot matrix printers. This is a problem
because the replacement parts will not be available for much longer.
So I'm trying to create a program
Robert Kern enlightened us with:
Yes, the .zip file format does store file permissions appropriate to
the platform that generates the file.
I never knew that! Thanks for correcting me ;-)
Sybren
--
The problem with the world is stupidity. Not saying there should be a
capital punishment for
PROPOSED EARTHQUAKE FORECASTING
COMPUTER PROGRAM DEVELOPMENT EFFORT
Posted July 11, 2005
My main earthquake forecasting Web page is:
http://www.freewebz.com/eq-forecasting/Data.html
Newsgroup Readers: If you circulate copies of this report to groups of
computer programmers at different
OTOH, I don't know if this has any relevance to the problem that you are
seeing.
not really, i have used the 'os.chmod' trick, but it's still
interesting.
thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Throne Software wrote:
Throne Software has opened up a Python Forum at:
http://www.thronesoftware.com/forum/
Join us!
Why should we ?
--
bruno desthuilliers
python -c print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])
--
I'm looking at the gettext module for the first time and
learning how to write internationalized code in Python.
Naturally, I also looked at the original Gnu gettext
manual, which mentions that comments can be captured
into the .po (.pot?) file for translators' benefit:
/* Comment right before
Hello,
I can't find the docs for __eq__ on a dict and I can't find
a description on what the eq does (strangely it does implement and
but I have no idea what that does). Does anyone know (definitively)
what the __eq__, __gt__, __lt__ methods do.
BTW, google is not my friend
On Mon, 11 Jul 2005 02:58:29 +, Bengt Richter wrote:
I think you are right about some game happening, but I'm not sure it's cat
and mouse.
To me, an incomplete question feels like an invitation to play 20 questions
regarding
what the real problem is. So I get a little annoyed, and
These methods are documanted here:
http://docs.python.org/ref/customization.html
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 11 Jul 2005 12:42:55 +0200, Neil Benn wrote:
Hello,
I can't find the docs for __eq__ on a dict and I can't find
a description on what the eq does (strangely it does implement and
but I have no idea what that does). Does anyone know (definitively)
what the __eq__,
[EMAIL PROTECTED] wrote:
These methods are documanted here:
http://docs.python.org/ref/customization.html
Hmm, can't see anything about implementation of python dict methods
__eq__, __lt__ or __gt__ there - general docs but not specific to the
dict here - at least not as far as I can see
Steven D'Aprano [EMAIL PROTECTED] writes:
On Mon, 11 Jul 2005 12:42:55 +0200, Neil Benn wrote:
Hello,
I can't find the docs for __eq__ on a dict and I can't find
a description on what the eq does (strangely it does implement and
but I have no idea what that does). Does
Reinhold Birkenfeld schrieb:
Kay Schluehr wrote:
Dan Sommers schrieb:
How about this:
def __init__(self, self.x, y, self.z):
# self.x, self.z from first and third explicit parameters
do_something_with_y()
Can you tell me in which way it is anyhow better than
Tim Peters [EMAIL PROTECTED] writes:
[Tim Peters]
All Python behavior in the presence of infinities, NaNs, and signed
zeroes is a platform-dependent accident, mostly inherited from that
all C89 behavior in the presence of infinities, NaNs, and signed
zeroes is a platform-dependent
Steven D'Aprano wrote:
On Mon, 11 Jul 2005 12:42:55 +0200, Neil Benn wrote:
Hello,
I can't find the docs for __eq__ on a dict and I can't
find a description on what the eq does (strangely it does implement
and but I have no idea what that does). Does anyone know
On Mon, 11 Jul 2005 08:34:45 +0200,
Reinhold Birkenfeld [EMAIL PROTECTED] wrote:
Kay Schluehr wrote:
Dan Sommers schrieb:
How about this:
def __init__(self, self.x, y, self.z):
# self.x, self.z from first and third explicit parameters
do_something_with_y()
Can you tell me in which
George Sakkis schrieb:
1. classes have metaclasses, functions don't have metafunctions. No one
gave an example for classes not handled at least as well with a metaclass.
Would something like the following count ?
@abstractclass
class AbstractFrame(object):
@abstractclass
Use the source, Luke
dict_richcompare:
http://fisheye.cenqua.com/viewrep/python/python/dist/src/Objects/dictobject.c?r=2.165#l1510
dict_compare:
http://fisheye.cenqua.com/viewrep/python/python/dist/src/Objects/dictobject.c?r=2.165#l1425
/Simon
--
Kay Schluehr wrote:
I think it would be a good idea to pronounce the similarity between
function decorators and metaclasses. Metaclasses were once introduced
as an arcane art of fuzzy bearded hackers or supersmart 'enterprise
architects' that plan at least products of Zope size but not as a
V Sat, 09 Jul 2005 10:22:06 -0400, Peter Hansen napsal(a):
David Siroky wrote:
When I compile my python files with python -OO into pyo files
then they still contain absolute paths of the source files which is
undesirable for me. How can I deal with that?
Don't do that?
Delete the
V Sat, 09 Jul 2005 11:48:51 -0700, ncf napsal(a):
Python is compiling the files with absolute paths because it is much
faster to load a file when you know where it is, than to have to find
it and then load it.
I'm guessing you're wondering this so you can distribute it compiled or
such? If
Dear All,
I am writing a database import script in python and I would like to
print the percentage of the process to the last line. I would like to
update the last line at every percent. You know what I mean.
How can the cursor be positioned to the last line or somewhere else on
the
Terry Reedy [EMAIL PROTECTED] writes:
Tim Peters [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[Donn Cave]
I ran into a phenomenon that seemed odd to me, while testing a
build of Python 2.4.1 on BeOS 5.04, on PowerPC 603e.
test_builtin.py, for example, fails a couple of
Hi,
Sorry to post what might seem like a trivial problem here, but its
driving me mad!
I have a simple https client that uses httplib to post data to a web
server.
When I post over http https using curl the data is recieved by the
web server with no problems.
When I post using my python
David Siroky [EMAIL PROTECTED] writes:
Hi!
When I compile my python files with python -OO into pyo files
then they still contain absolute paths of the source files which is
undesirable for me. How can I deal with that?
Are you trying to save space? In 2.4 and later each code object
Dan Sommers wrote:
Without thinking it all the way through, I suppose these:
def method_1(self, *self.l):
pass
def method_2(self, **self.d):
pass
could act as if they were these:
def method_1(self, *args):
self.l = args
del args
def
Am Sat, 09 Jul 2005 20:30:04 -0700 schrieb spike grobstein:
I'm a total Python newbie, so bear with me here...
I'm writing a program that has a user-configurable, module-based
architecture. it's got a directory where modules are stored (.py files)
which subclass one of several master
Am Mon, 11 Jul 2005 06:29:23 -0700 schrieb michaelparkin:
Hi,
Sorry to post what might seem like a trivial problem here, but its
driving me mad!
I have a simple https client that uses httplib to post data to a web
server.
When I post over http https using curl the data is recieved by
David Siroky wrote:
When I compile my python files with python -OO into pyo files
then they still contain absolute paths of the source files which is
undesirable for me. How can I deal with that?
Use the script compileall.py (in Lib) to compile all the files. This
script has an option -d
when i write a code to import some module like the following :
from nltk.probability import ConditionalFreqDist
I got the error :
Traceback (most recent call last): File "C:\Python24\toky.py", line 1, in -toplevel- from nltk.probability import ConditionalFreqDist File
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Well, his Viaweb company was founded in about '95, right? So he probably
just
used Lisp because Python wasn't as well known yet. ;-)
David
That is what I thought too. It makes sense but I wasn't sure. Still
ain't.
The problem
While not curses based this class will update screen as you
want. You could use it as a basis upon which to do a curses
version with your cursor positioning.
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/299207
-Larry Bates
Mage wrote:
Dear All,
I am writing a database
Hello all,
I've read all the posts concerning relative imports of modules and I am
glad I saw some consensus on a syntax.
At this moment I am however bound to python 2.3.
Does anyone know a good workaround (or a library) which can achieve a
relative import for this python version
kind regards
Larry Bates wrote:
While not curses based this class will update screen as you
want. You could use it as a basis upon which to do a curses
version with your cursor positioning.
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/299207
Thank you. This is good for displaying the
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Mage
Sent: 11 July 2005 04:28 PM
To: python-list@python.org
Subject: Re: cursor positioning
Larry Bates wrote:
While not curses based this class will update screen as you
want. You could use it as a basis
Ed Leafe wrote:
On Jul 7, 2005, at 7:27 AM, Fuzzyman wrote:
Do you have an exception handling dialog ?
Not per se, as there hasn't been a request for one; we have several
dialogs ranging from simple messages to alerts to interactive dialogs,
much as wxPython offers. But I'll make
I haven't tried this myself, but I think the secret to displaying a
continuously updating %done on the command line is to
print file 100, 1% done
then send exactly 7 backspaces to the terminal, then print 2% done...
so the backspaces will write over the previous text.
Backspace is a \x08
James Carroll wrote:
I haven't tried this myself, but I think the secret to displaying a
continuously updating %done on the command line is to
print file 100, 1% done
then send exactly 7 backspaces to the terminal, then print 2% done...
so the backspaces will write over the previous text.
my reason for loading both the .py and .pyc files was just in case
compiled files were supplied as modules... but I'm gonna disallow that,
so yeah.
I also got a response in email and I've been dabbling with my code
since I posted this and found a slightly better way of handling this
plugin
On Sun, 10 Jul 2005 21:10:36 -0700, Michael Spencer [EMAIL PROTECTED] wrote:
Bengt Richter wrote:
...
class Foo(object):
class __metaclass__(type):
def __setattr__(cls, name, value):
if type(cls.__dict__.get(name)).__name__ == 'Descriptor':
raise
Here's a simple module for doing progress reporting. On systems without
curses, it simply uses \r to return the cursor to the first column.
On systems with curses, it also clears to the end of the line. This
means that when the progress message gets shorter, there aren't droppings
left from the
What would the best way to get a list of files in a subdirectory in a zip?
The only thing I can come up with is to extract the zip into a temp
directory and then just grab the list of files in the subdirectory
that I need. This way seems very messy to me and I was wondering if
there are any
I am (very) new top regular expressions and I am having a difficult time
understanding how to do them. I have the following in my script:
zaidsearch = r'''^ {5,}([\d]{4,5})(.\d{2,2}c)'''
ZAIDSearch = re.compile(search, re.IGNORECASE)
When I do: ZAID.search(...) then this works fine. I would
def joels_function(args):
error_result = 0
good_result = None
process(args)
if error_condition():
error_result = -1 # flag for an error
elif different_error_conditon():
error_result = -2
else:
more_processing()
if
On Mon, 11 Jul 2005 01:44:07 -0400, Terry Reedy [EMAIL PROTECTED] wrote:
Bengt Richter [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Me too. I liked the leading _, but on second thought it is a weird
language change
re names in a special context. Probably not so good.
To
Python using CGI, for example, was enough for him until he started
getting 500 errors that he wasn't sure how to fix.
A common error is that python cgi files need line endings to be in
unix text file format, not windows text file format (\n instead of
\r\n) [1]. Why this is, I don't know, but
Jeremy wrote:
I am (very) new top regular expressions and I am having a difficult time
understanding how to do them. I have the following in my script:
zaidsearch = r'''^ {5,}([\d]{4,5})(.\d{2,2}c)'''
ZAIDSearch = re.compile(search, re.IGNORECASE)
When I do: ZAID.search(...) then this
Christopher Subich schrieb:
Kay Schluehr wrote:
I think it would be a good idea to pronounce the similarity between
function decorators and metaclasses. Metaclasses were once introduced
as an arcane art of fuzzy bearded hackers or supersmart 'enterprise
architects' that plan at least
On Mon, 11 Jul 2005 15:37:35 +0200, Reinhold Birkenfeld [EMAIL PROTECTED]
wrote:
Dan Sommers wrote:
Without thinking it all the way through, I suppose these:
def method_1(self, *self.l):
pass
def method_2(self, **self.d):
pass
could act as if they were these:
Actually, we receive the data in the form of a text file. The original
data is sent from an IBM mainframe then to Ottawa where it is captured
by an SNA Print Server that receives the VPS print jobs, writes them
to disk and then runs a PERL script program on the disk file. This
PERL script
I've got a pure python module that parses a certain type of file. It
has a load() function that allows a callback function to be passed for
getting progress information.
In straight python, this works fine.
However, I'm now trying to use this from a C++ program. The current
flow that I'm trying
Echo wrote:
What would the best way to get a list of files in a subdirectory in a zip?
The only thing I can come up with is to extract the zip into a temp
directory and then just grab the list of files in the subdirectory
that I need. This way seems very messy to me and I was wondering if
Hi,
When I try to upload many files I get such a error message:
Traceback (most recent call last):
File I:\Python\my_py\wwwzaci\xcopy_ftp.py, line 51, in ?
except: x=host.upload(zdroj, cilFTP,'b')
File C:\prg\python24\Lib\site-packages\ftputil\ftputil.py, line 463, in uplo
ad
Randy Howard wrote:
Keith Thompson wrote
(in article [EMAIL PROTECTED]):
\/| |\| __\,,\ /,,/__
\||/ | | | jgs (__Y__)
/\/\/\/\/\/\/\/\//\/\\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Hi all,
I have a dictionary containing about 300 items, some of the values being
repeated. Both keys and values are strings. How can I turn this thing on
its head so that we create a key based on each unique value and build the
values based on the keys corresponding to the repeated values?
Hello,
Try that, it may not be the better solution, but it seems to work:
#def invertDict(d):
# d2 = {}
# for k, v in d.iteritems():
# d2.setdefault(v, []).append(k)
# return d2
Cyril
On 7/11/05, Ric Da Force [EMAIL PROTECTED] wrote:
Hi all,I have a dictionary containing about 300 items, some
Hi!
Dict = {'rt': 'repeated', 'sr':'repeated', 'gf':'not repeated'}
NewDic = {}
for k,v in Dict.items():
NewDic.setdefault(v, []).append(k)
Regards, mawe
--
http://mail.python.org/mailman/listinfo/python-list
Hum... I think an iteritems is better, this way, python don't need to create in memory
a complete list of couple key, value.On 7/11/05, Markus Weihs [EMAIL PROTECTED] wrote:
Hi! Dict = {'rt': 'repeated', 'sr':'repeated', 'gf':'not repeated'} NewDic = {} for k,v in Dict.items():
Ric Da Force [EMAIL PROTECTED] writes:
It is hard to explain but this is what I mean:
Dict = {'rt': 'This is repeated', 'sr': 'This is repeated', 'gf': 'This is
not'}
I want this to return a new dict with string keys and lists containing the
previous keys for repeated values.
Mark Jackson wrote:
Ric Da Force [EMAIL PROTECTED] writes:
It is hard to explain but this is what I mean:
Dict = {'rt': 'This is repeated', 'sr': 'This is repeated', 'gf': 'This is
not'}
I want this to return a new dict with string keys and lists containing the
previous keys for
Hi,
On Mon, 11 Jul 2005 15:29:41 +0200, Mage wrote:
Dear All,
I am writing a database import script in python and I would like to
print the percentage of the process to the last line. I would like to
update the last line at every percent. You know what I mean.
How can the
On Monday 11 July 2005 09:19 am, peter wrote:
I've read all the posts concerning relative imports of modules and I am
glad I saw some consensus on a syntax.
At this moment I am however bound to python 2.3.
Does anyone know a good workaround (or a library) which can achieve a
relative import
--- Bengt Richter [EMAIL PROTECTED] wrote:
I still think it's too specialized. What would, hypothetically, this do?
class Bar: pass
class Foo:
x = Bar()
def method_1(self, x.y):
pass
It's hard to explain that you can autoassign self.y but not x.y.
No, that
enas khalil wrote:
when i write a code to import some module like the following :
from nltk.probability import ConditionalFreqDist
I got the error :
Traceback (most recent call last):
File C:\Python24\toky.py, line 1, in -toplevel-
--- Robert Williscroft [EMAIL PROTECTED] wrote:
My apologies for having to resort to email but for some reason I can't post
this message to comp.lang.python. I've tried about 4 times including
starting a
new thread, but for some reason it doesn't turn up, though I've followed
up on
Is it possible to set an environment variable in python script whose
value is retained even after the script exits.
Doing the following creates an environment variable name which is
visible to only subprocesses created by os.system() and os.popen().
os.putvar(name, vivek)
Is it possible to
On 2005-07-11, Vivek Chaudhary [EMAIL PROTECTED] wrote:
Is it possible to set an environment variable in python script whose
value is retained even after the script exits.
No, not in Unix/Linux. In VMS I think there is.
--
Grant Edwards grante Yow! I think
François Pinard [EMAIL PROTECTED] wrote:
Mascyma is (trying to be) a user-friendly graphical frontend for
the Computer Algebra System GNU MAXIMA.
I was not successful googling for this one. Would you have an URL handy?
Oops, OK! Found it at http://cens.ioc.ee/~pearu/misc/maxima/ .
I am using this function to parse data I have stored in an array.
This is what the array looks like:
[['Memory', '0', 'Summary', '0'], ['Memory', '0', 'Speed',
'PC3200U-30330'], ['Memory', '0', 'Type', 'DDR SDRAM'], ['Memory', '0',
'Size', '512'], ['Memory', '0', 'Slot', 'DIMM0/J11'], ['Memory',
The next meeting of BayPIGgies will be Thurs, July 14 at 7:30pm at
Google, building 40, room Temp Tech Talk.
Alex Martelli will be doing his Black Magic talk on descriptors,
decorators, and metaclasses. Prepare to have your head exploded!
BayPIGgies meetings alternate between IronPort (San
Vivek Chaudhary enlightened us with:
Is it possible to set an environment variable in python script whose
value is retained even after the script exits.
It is, if you have absolute control over the calling environment.
Is it possible to somehow create this environment variable inside
python
I want to write an application that embeds and extends (at least) the
Python and Perl interpreters. Now i want to find as much as possible
about the Python tools used for extending and embedding Python.
To be more specific: My app should:
1. Parse an input file.
2. Call a script in some
Is it possible to set an environment variable from inside the python
script which will be retained after the script exits.
If I use the following code:
import os
os.putvar(name, tuxlover)
the enivironment variable name is visible to only the sub-process
created by os.system and os.popen. But as
Your code is needlessly complicated.
Instead of this business
while 1:
try:
i = fetch.next()
except stopIteration:
break
simply write:
for i in fetch:
(if there's an explicit 'fetch = iter(somethingelse)' in code you did
not show, then get rid of
edgrsprj [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
PROPOSED EARTHQUAKE FORECASTING
COMPUTER PROGRAM DEVELOPMENT EFFORT
it jumps strait to the display routine and uses the entered command to
begin
Should be the word straight instead of strait.
--
Ralf W. Grosse-Kunstleve wrote in
news:[EMAIL PROTECTED] in
comp.lang.python:
--- Robert Williscroft [EMAIL PROTECTED] wrote:
My apologies for having to resort to email but for some reason I
can't post this message to comp.lang.python. I've tried about 4 times
including starting a
new
Why don't tuples support an index method?
It seems natural enough ...
Thanks,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
Is it possible to set an environment variable from inside the python
script which will be retained after the script exits.
If I use the following code:
import os
os.putvar(name, tuxlover)
the enivironment variable name is visible to only the sub-process
IIRC, the self.__dict__.update(locals()) trick confuses psyco.
But you can make a decorator to achieve the same result. There's not
really a convincing case for extending python syntax.
def attribute_decorator(f):
import inspect
argnames = inspect.getargspec(f)[0]
def
Hi,
I'm a beginner, and what I want to accomplish is this:
1. For all files under several folders, do some processing (using an
existing program). The program will output one line of text for each
file.
2. Store the output of all files in one file.
It would be great if someone can give me a
On 2005-07-11, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I'm a beginner, and what I want to accomplish is this:
1. For all files under several folders, do some processing (using an
existing program). The program will output one line of text for each
file.
2. Store the output of all files
Sorry for posting twice.
--
http://mail.python.org/mailman/listinfo/python-list
use os.path.walk() or os.walk()
Tuxlover
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
Sorry for posting twice.
Sorry for forgetting my wink. wink
Reinhold
--
http://mail.python.org/mailman/listinfo/python-list
--- Lonnie Princehouse [EMAIL PROTECTED] wrote:
IIRC, the self.__dict__.update(locals()) trick confuses psyco.
But you can make a decorator to achieve the same result. There's not
really a convincing case for extending python syntax.
Not if you have (enough memory for) psyco. :)
I am
I have some data in the following format:
Fred Flintstone,445553454,47634565
Wilma Flintstone,74857346,27576847
Barney Rubble,73487346,27576435
I need to convert this data into a report with the user's name and
difference between the 2 numbers.
Can someone recommend a good way to do this?
I'd like to proffer the suggestion we meet for dinner at 6pm at Mei
Long in Mountain View, although it's probably best to run it past our
dinner coordinator first to make sure it gets his OK. What say you
Brian ?
On 7/11/05, Aahz [EMAIL PROTECTED] wrote:
Before the meeting, we may meet at
On 2005-07-11, ChrisH [EMAIL PROTECTED] wrote:
I have some data in the following format:
Fred Flintstone,445553454,47634565
Wilma Flintstone,74857346,27576847
Barney Rubble,73487346,27576435
I need to convert this data into a report with the user's name and
difference between the 2
Terry Hancock wrote:
/* Comment right before the gettext call, obviously in C */
printf(_(Apparently ambiguous string to translate));
This will get captured into the .po file, according to the
gettext manual and appear as a comment right before
the msgid (i.e. next to the line number
Here's an example from some book:
def foo(n):
s = [n]
def bar(i):
s[0] += i
return s[0]
return bar
what I don't understand is how this example works, taking into account
the LGB rule. I thought that s is not accessible from bar, but it is,
Hugh Macdonald wrote:
The problem in this workflow is taking the C python function that I've
defined (using the standard static PyObject *someFunction(PyObject
*self, PyObject *args) method) and converting this into a Py_Object.
Any ideas?
You should use PyCFunction_New(Ex), passing a static
Tommy Nordgren wrote:
In order to correctly compile and link my Application, I need a OS
independent way to find compiler options and linker options necessary to
find header files and libraries. What methods should I use from
DistUtils for this purpose.
I don't think distutils supports
The correct answer to the above question
How long is a piece of string?
is
2 times half it's length
CEC
--
http://mail.python.org/mailman/listinfo/python-list
Ralf W. Grosse-Kunstleve wrote in
news:[EMAIL PROTECTED] in
comp.lang.python:
Does anyone know if there is a way to hide the _ or self_ from the
user of the class, i.e. given:
class foo(object):
@attribute_decorator
def __init__(self, x, _y, z):
pass
can we
vch wrote:
Here's an example from some book:
def foo(n):
s = [n]
def bar(i):
s[0] += i
return s[0]
return bar
what I don't understand is how this example works, taking into account
the LGB rule. I thought that s is not accessible from
--- Rob Williscroft [EMAIL PROTECTED] wrote:
def init_self( init ):
class KeywordArgumentError(Exception):
pass
vn = init.func_code.co_varnames[ 1 : init.func_code.co_argcount ]
def decorated_init(self, *args, **kw):
off = 0
for name in vn:
if not
1 - 100 of 157 matches
Mail list logo