Re: List of All Error Menssages

2020-10-02 Thread Luis Gustavo Araujo
ew exception message is written somewhere > within the standard library. It would not be very sustainable, even more so > if you consider that CPython development is mostly volunteer-driven efforts. > > Regards, > Kyle Stanley > > On Thu, Oct 1, 2020 at 3:18 PM Luis Gustavo Ar

Re: List of All Error Menssages

2020-10-01 Thread Luis Gustavo Araujo
cs.python.org/3/library/exceptions.html) I only can check the type error. []s Em qui., 1 de out. de 2020 às 15:59, Luis Gustavo Araujo < luisaraujo.i...@gmail.com> escreveu: > Hi, > Is it possible to get the list of all error messages that display in > Python? I want th

Re: SSLSocket.getpeercert() doesn't return issuer, serial number, etc

2012-08-17 Thread Gustavo Baratto
Awesome guys! Thank you very much! I ended up using "binary_form=True" and using M2Crypto to parse the cert. Cheers, g. On Thu, Aug 16, 2012 at 4:48 AM, Antoine Pitrou wrote: > > Hello, > > Gustavo Baratto gmail.com> writes: > > > > SSL.Socket.g

SSLSocket.getpeercert() doesn't return issuer, serial number, etc

2012-08-15 Thread Gustavo Baratto
Hello there, SSL.Socket.getpeercert() doesn't return essential information present in the client certificate (issuer, serial number, not before, etc), and it looks it is by design: http://docs.python.org/library/ssl.html#ssl.SSLSocket.getpeercert http://hg.python.org/cpython/file/b878df1d23b1/Mod

Re: Performance of list vs. set equality operations

2010-04-06 Thread Gustavo Narea
On Apr 6, 7:28 pm, Chris Colbert wrote: > the proof is in the pudding: > > In [1]: a = range(1) > > In [2]: s = set(a) > > In [3]: s2 = set(a) > > In [5]: b = range(1) > > In [6]: a == b > Out[6]: True > > In [7]: s == s2 > Out[7]: True > > In [8]: %timeit a == b > 1000 loops, best of 3: 2

Performance of list vs. set equality operations

2010-04-06 Thread Gustavo Narea
to compare them as sets. And as a consequence, the more equivalent elements two collections have, the faster it is to compare them as lists. Is this correct? This is why so many people advocate the use of sets instead of lists/ tuples in similar situations, right? Cheers, - Gustavo

ctypes WNetGetUniversalNameW

2009-09-02 Thread Gustavo
Hello, I'm trying to call WNetGetUniversalNameW via the ctypes module but I'm only causing the interpreter to crash. Unfortunately I don't have much experience with the ctypes module and I'm still trying to figure it out. I've searched for a solution to no avail. My confusion is centered around th

Re: WSDL and XML generation

2009-07-28 Thread Gustavo Andrés Angulo
Hi you can generate the WSDl with soaplib [1], and you can view web.py or django for this: for web.py -> http://webpy.org/cookbook/webservice for django -> http://www.djangosnippets.org/snippets/979/ [1]=> http://trac.optio.webfactional.com/ > Hi all > Newbie in Python, i am looking for some

Re: Rich comparison methods don't work in sets?

2009-06-21 Thread Gustavo Narea
Hi, everyone. OK, I got it now! The value of the hash is not decisive, as __eq__ will still be called when the hashes match. It's like a filter, for performance reasons. It's really nice, I just tried it and it worked. Thank you very, very much!! Cheers, - Gustavo

Re: Rich comparison methods don't work in sets?

2009-06-20 Thread Gustavo Narea
I guess I'll have to use something like the function of my first post. :( Thanks, - Gustavo. -- http://mail.python.org/mailman/listinfo/python-list

Rich comparison methods don't work in sets?

2009-06-19 Thread Gustavo Narea
Hello, everyone. I've noticed that if I have a class with so-called "rich comparison" methods (__eq__, __ne__, etc.), when its instances are included in a set, set.__contains__/__eq__ won't call the .__eq__ method of the elements and thus the code below: """ obj1 = RichComparisonClass() obj2 = Ric

Re: Best way to evaluate boolean expressions from strings?

2009-04-28 Thread Gustavo Narea
Thank you very much, Gabriela and Peter! I'm going for Pyparsing. :) -- Gustavo. -- http://mail.python.org/mailman/listinfo/python-list

Best way to evaluate boolean expressions from strings?

2009-04-27 Thread Gustavo Narea
Hello, everybody. I need to evaluate boolean expressions like "foo == 1" or "foo ==1 and (bar > 2 or bar == 0)" which are defined as strings (in a database or a plain text file, for example). How would you achieve this? These expressions will contain placeholders for Python objects (like "foo" an

Re: Turning a signature-changing decorator into a signature-preserving one

2009-02-16 Thread Gustavo Narea
On Feb 16, 5:18 pm, Michele Simionato wrote: > On Feb 16, 4:59 pm, Gustavo Narea wrote: > > > > > I've not seen anything special in Pylons or TurboGears 2 decorators, > > except that they are all functions that use the decorator package -- > > while my decora

Re: Turning a signature-changing decorator into a signature-preserving one

2009-02-16 Thread Gustavo Narea
On Feb 16, 4:59 pm, Gustavo Narea wrote: > On Feb 16, 4:40 pm, Michele Simionato > wrote: > > > > > > It was broken from the beginning on Pylons. > > > > I'm a TurboGears 2 core developer, and TurboGears is powered by Pylons > > > as of versio

Re: Turning a signature-changing decorator into a signature-preserving one

2009-02-16 Thread Gustavo Narea
On Feb 16, 4:40 pm, Michele Simionato wrote: > > It was broken from the beginning on Pylons. > > > I'm a TurboGears 2 core developer, and TurboGears is powered by Pylons > > as of version 2. The decorator has always worked in TurboGears because > > of the way TG finds the action arguments, but now

Re: Turning a signature-changing decorator into a signature-preserving one

2009-02-16 Thread Gustavo Narea
On Feb 16, 4:18 pm, Michele Simionato wrote: > Yes, I am saying don't mess with the internal mechanism of Pylons and > leave it as > it was. Or was it broken from the beginning? The only reason I see for > you > to touch those things is if you are a Pylons core developer. It was broken from the b

Re: Turning a signature-changing decorator into a signature-preserving one

2009-02-16 Thread Gustavo Narea
On Feb 16, 3:56 pm, Michele Simionato wrote: > On Feb 16, 3:50 pm, Gustavo Narea wrote: > > > On Feb 14, 3:27 pm, Michele Simionato > > wrote: > > > > I lack the context to see how this could be fixed in your case, but > > > this a not a show stopper, y

Re: Turning a signature-changing decorator into a signature-preserving one

2009-02-16 Thread Gustavo Narea
t how can I do that? Thanks for all the time you've spent on this, Michele. - Gustavo. -- http://mail.python.org/mailman/listinfo/python-list

Re: Turning a signature-changing decorator into a signature-preserving one

2009-02-14 Thread Gustavo Narea
On Feb 14, 6:38 am, Michele Simionato wrote: > On Feb 14, 12:56 am, Gustavo Narea wrote: > > > > > Hello, everybody. > > > I have this signature-changing decorator > > <http://paste.chrisarndt.de/paste/15aac02a90094a41a13a1b9b85a14dd6> > > which I >

Turning a signature-changing decorator into a signature-preserving one

2009-02-13 Thread Gustavo Narea
this error: http://paste.chrisarndt.de/paste/33e06be6e6d74e49b05c45534dfcc9fe?wrap=no What am I doing wrong? I think it looks like this example: http://pypi.python.org/pypi/decorator#async Thanks in advance. - Gustavo. PS: functols.wrap is not an option because my code has to work with Pyt

Grandchildren of TestCase don't work

2008-08-19 Thread Gustavo Narea
;     testMethod = getattr(self, self._testMethodName) > AttributeError: 'TestDatabaseGrandChildTesting' object has no > attribute '_testMethodName' Isn't it possible to use grand-grandchildren of unittest.TestCase? Please use this file to reproduce it: http://paste.

xmlrpc client through proxy to https server

2008-08-12 Thread Gustavo Rahal
nsport() p.set_proxy('9.47.67.150:3128') server = xmlrpclib.Server('https://ftp3.linux.ibm.com/rpc/index.php', transport=p) print server.user.ingroup("username", "group") --- The Result: xmlrpclib.ProtocolError: The method i'm calling is &q

Re: a Roguelike in Python

2008-03-12 Thread Gustavo DiPietro
[EMAIL PROTECTED] ha scritto: > Seeing the 7DRL start up recently, i wanted to see what one was made > of. Python is the language i'm most familiar with so i searched for > some code to look at, but i couldn't find any. Can anyone direct me to > the right place? > > I did some searching on what it

Re: [Python-Dev] Python 3000 PEP: Postfix type declarations

2007-04-01 Thread Gustavo Carneiro
On 4/1/07, Gustavo Carneiro <[EMAIL PROTECTED]> wrote: On 4/1/07, Georg Brandl <[EMAIL PROTECTED]> wrote: [...] > Example > === > > This is the standard ``os.path.normpath`` function, converted to type > declaration > syntax:: > > def normpathƛ(p

Re: [Python-Dev] Python 3000 PEP: Postfix type declarations

2007-04-01 Thread Gustavo Carneiro
hat Python should support type annotations, but they should be optional and only present at the function interfaces, i.e. specify the type in the function parameter lists, like in plain old C. +1 from me for allowing unicode identifiers. -MAXVOTE for type annotations in identifiers. -- Gustavo J. A. M. Carneiro "The universe is always one step beyond logic." -- http://mail.python.org/mailman/listinfo/python-list

[ANN] python-dateutil 1.1

2005-12-22 Thread Gustavo Niemeyer
year, using Western, Orthodox or Julian algorithms; * More than 450 test cases. Where to get it? http://labix.org/python-dateutil -- Gustavo Niemeyer http://niemeyer.net -- http://mail.python.org/mailman/listinfo/python-list

Re: complex data types?

2005-09-17 Thread Gustavo Picon
On Sat, 2005-09-17 at 23:34 -0500, Gustavo Picon wrote: > Maybe something like this? > > class music(object): > def __init__(self): > self.lst = {} > def __setattr__(self, name, value): > self.__dict__[name] = value > > array = [] > array.

Re: complex data types?

2005-09-17 Thread Gustavo Picon
usic()) array.append(music()) # begin quoting your code array[0].artist = 'genesis' array[0].album = 'foxtrot' array[0].songs = ['watcher', 'time table', 'friday'] array[1].artist = 'beatles' array[1].album = 'abbey road' array[1]

Re: First Script Problem

2005-09-16 Thread Gustavo Picon
> ipFile.close() > You should be using different variables in that algorithm, because you are concatenating strings to "mySET" over and over again. A more efficient approach would be something like: def findIPs(): ip = 0 while ip < 256**4: print '.'.jo

Re: No newline using printf

2005-09-15 Thread Gustavo Picon
> How can I print a word without appending a newline character? Appending > a "," to the print statement only substitutes the newline for a space, > which is not what I am looking for. > Try with: print ''.join(str(foo) for foo in range(3)) or sys.stdout.write

[ANN] python-dateutil 1.0

2005-07-19 Thread Gustavo Niemeyer
world timezone information based on Olson's database. * Computing of Easter Sunday dates for any given year, using Western, Orthodox or Julian algorithms; * More than 400 test cases. Where to get it? https://moin.conectiva.com.br/DateUtil -- Gustavo Niemeyer

ANN: python-constraint 1.0

2005-07-08 Thread Gustavo Niemeyer
ive backtracking solver - Minimum conflicts solver Predefined constraint types currently available: - FunctionConstraint - AllDifferentConstraint - AllEqualConstraint - ExactSumConstraint - MaxSumConstraint - MinSumConstraint - InSetConstraint - NotInSetConstraint - SomeInSetConstraint - SomeNotInS

Re: ANN: python-constraint 1.0

2005-07-07 Thread Gustavo Niemeyer
pired me to write that module. IIRC, there's also some kind of constraint code in Python by one of the book authors (Peter Norvig). For those who are interested, chapter 5, which talks about CSPs, may be found in the web site. > Gustavo, maybe we should coordinate and merge our efforts? Prob

ANN: python-constraint 1.0

2005-07-06 Thread Gustavo Niemeyer
ive backtracking solver - Minimum conflicts solver Predefined constraint types currently available: - FunctionConstraint - AllDifferentConstraint - AllEqualConstraint - ExactSumConstraint - MaxSumConstraint - MinSumConstraint - InSetConstraint - NotInSetConstraint - SomeInSetConstraint - SomeNotInS

Re: f*cking re module

2005-07-05 Thread Gustavo Niemeyer
> To reply to the last part of the discussion and esspecially to Gustavo > Niemeyer, I really apriciate the way in which I had been answered. And > I won't have any questions about the re module that I had before I > post this threat. Great! As I said, that's a nic

Re: f*cking re module

2005-07-04 Thread Gustavo Niemeyer
oup takes an argument, anyway). That's what I love in that news group. Someone comes with a stupid and arrogant question, and someone else answers in a calm and reasonable way. Thanks Erik. -- Gustavo Niemeyer http://niemeyer.net -- http://mail.python.org/mailman/listinfo/python-list

Re: how to apply "mvc" pattern to gui-design in python

2005-03-28 Thread Gustavo Rahal
Swaroop C H wrote: On Mon, 28 Mar 2005 17:26:14 +0800, Su Wei <[EMAIL PROTECTED]> wrote: i have a project want to develop with python. who can tell me that how to apply "mvc" pattern to gui-design in python. please give me some advices! ths in advanced. This may help you: http://pygtkmvc.sourcefo

[ANN] dateutil 0.9

2005-02-24 Thread Gustavo Niemeyer
- Changed weekday to spell the not-set n value as None instead of 0. - Fixed other reported bugs. [1] http://www.twinsun.com/tz/tz-link.htm -- Gustavo Niemeyer http://niemeyer.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Platform independent adduser script?

2005-02-21 Thread Gustavo Rahal
Hi On redhat you can use a libuser module that provides some highlevel system tasks. redhat-tools use this module all the time.. look at some sources Gustavo morphex wrote: Hi there, does anyone here know of a script that enables adding of users on UNIX platforms via python? Thanks, Morten

thread / twisted defered etc...

2005-02-10 Thread Gustavo Rahal
amer so if possible detailed explanations are appreciated :) Thanks Gustavo -- http://mail.python.org/mailman/listinfo/python-list

Re: Another RegEx Question...

2004-12-13 Thread Gustavo Niemeyer
tion use the "*" character and > to do a Regular Expression search inside a Python code? >>> import fnmatch >>> fnmatch.fnmatch("myfilename", "*yf*nam*") True >>> fnmatch.translate("*") '.*$' >>> fnmatch.translate("?yf*nam?") '.yf.*nam.$' -- Gustavo Niemeyer http://niemeyer.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Python for Palm OS?

2004-12-10 Thread Gustavo Niemeyer
> Is there any news regarding Python on the Palm OS front? As an interesting side effect of the recently announced PalmOS on Linux, porting Python for that platform will become a lot easier, hopefully. If only I could find Tim's time-machine and bring a unit from the future. ;-) --

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2)

2004-12-04 Thread Gustavo Córdova Avila
Thomas Heller wrote: Gerrit <[EMAIL PROTECTED]> writes: Cameron Laird wrote: Subject: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2) What is the frequency of the weekly Python-URL? (-; According to the name, about 1.6 µHz. Thomas NOW you've done it!! Made me s

Re: non blocking read()

2004-12-02 Thread Gustavo Córdova Avila
Steve Holden wrote: Gustavo Córdova Avila wrote: Actually the op did mention that he wanted to monitor files. As was pointed out to me when I made the same assertion, he actually said "file object which is stdin" or something like that, which means the object could be a socket, a pipe,

Re: non blocking read()

2004-12-02 Thread Gustavo Córdova Avila
indeed talking about a pipe or something that really can block, and you call fileobject.read(1024), it will block until it gets 1024 bytes. Donn Cave, [EMAIL PROTECTED] Actually the op did mention that he wanted to monitor files. -- Gustavo Córdova Avila <[EMAIL PROTECTED]> <mailto:[EMAI

Re: non blocking read()

2004-12-01 Thread Gustavo Córdova Avila
't this still block if the input just happened to end at a multiple of the read size (1024)? -- David No, it'll read up to 1024 bytes or as much as it can, and then return an apropriatly sized string. -- Gustavo CÃrdova Avila <[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTE

Re: Python 3000 and "Python Regrets"

2004-12-01 Thread Gustavo Córdova Avila
Brad Tilley wrote: Matt Gerrans wrote: Anyway, what's to worry about?When the time comes just whip out a little script that converts Python 1.6 (or whatever you like) to Python3K; it will only take seven lines of P3K code. How about 'import classic' from past import python23

Re: comment out more than 1 line at once?

2004-11-30 Thread Gustavo Córdova Avila
th embeded comments ! */ #endif Rob. Actually, it's infinitly [sp?] more defficient (contrary of efficient?) than triple-quoted strings or line-by-line comments, because those two never make it to execution stage, because they're dropped by the compiler. :-) -- Gustavo Córdova Avi

Re: comment out more than 1 line at once?

2004-11-30 Thread Gustavo Córdova Avila
ines of code: triple-quoted strings. Strings which are unassigned in a source file are dropped by the compiler, so they don't make it to the execution stage; they're nice that way. -- Gustavo Córdova Avila <[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED]> *Tel:* +52 (81) 8130-1919 ext

Re: Protecting Python source

2004-11-30 Thread Gustavo Córdova Avila
nt. :) This cannot be the whole truth otherwise they wouldn't release embarrasing binaries. BWAAHHAHAHA!!! Damn you!! Coke is so hard to clean off a keyboard!! Good laugh, thankyou so much :-D -- Gustavo CÃrdova Avila <[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED]> *Tel:* +52 (81) 813

Anybody using Arch?

2004-11-29 Thread Gustavo Córdova Avila
Does anybody have an Arch archive with the current python source I could slurp it from? Thanks in advance :-) -- Gustavo Córdova Avila <[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED]> *Tel:* +52 (81) 8130-1919 ext. 127 Integraciones del Norte, S.A. de C.V. Padua #6047, Colonia Satéli