nested embedding of interpreter

2012-02-06 Thread Eric Frederich
uld do... int session = Py_Initialize() Py_Finalize(session) But obviously, CPython is not coded that way so it is not supported. Thanks, ~Eric -- http://mail.python.org/mailman/listinfo/python-list

Python usage numbers

2012-02-11 Thread Eric Snow
ource. If the numbers aren't out there, what would some good approaches to discovering them? Thanks! -eric -- http://mail.python.org/mailman/listinfo/python-list

Re: Python usage numbers

2012-02-11 Thread Eric Snow
On Sat, Feb 11, 2012 at 2:51 PM, Andrew Berg wrote: > On 2/11/2012 3:02 PM, Eric Snow wrote: >> I'm thinking about this partly because of the discussion on >> python-ideas about the perceived challenges of Unicode in Python 3. > >> For instance, if frameworks

Re: Python usage numbers

2012-02-11 Thread Eric Snow
On Sat, Feb 11, 2012 at 6:28 PM, Chris Angelico wrote: > On Sun, Feb 12, 2012 at 12:21 PM, Eric Snow > wrote: >> However, in at >> least one current thread (on python-ideas) and at a variety of times >> in the past, _some_ people have found Unicode in Python 3 to m

(Rebooting) Python Usage Statistics

2012-02-13 Thread Eric Snow
e numbers would be a valuable resource. If the numbers aren't out there, what would some good approaches to discovering them? Thanks! -eric -- http://mail.python.org/mailman/listinfo/python-list

multiprocessing, what am I doing wrong?

2012-02-23 Thread Eric Frederich
Below is some pretty simple code and the resulting output. Sometimes the code runs through but sometimes it just freezes for no apparent reason. The output pasted is where it just got frozen on me. It called start() on the 2nd worker but the 2nd worker never seemed to enter the run method. ###

Re: multiprocessing, what am I doing wrong?

2012-02-24 Thread Eric Frederich
I can sill get it to freeze and nothing is printed out from the other except block. Does it look like I'm doing anything wrong here? On Thu, Feb 23, 2012 at 3:42 PM, MRAB wrote: > On 23/02/2012 17:59, Eric Frederich wrote: > >> Below is some pretty simple code and the

Re: multiprocessing, what am I doing wrong?

2012-02-27 Thread Eric Frederich
ning Worker 2 2 9 20 35 54 77 104 135 170 209 252 299 350 405 464 527 594 665 Traceback (most recent call last): File "./multi.py", line 53, in print result_queue.get() File "/home/frede00e/software/python/lib/python2.7/multiprocessing/queues.py", line 91, in get res =

Re: multiprocessing, what am I doing wrong?

2012-02-28 Thread Eric Frederich
27/02/2012 16:57, Eric Frederich wrote: > >> Still freezing sometimes, like 1 out of 10 times that I run it. >> Here is updated code and a couple of outputs. >> >> [snip] > I don't know what the problem is. All I can suggest is a slightly > modified version. &

Re: Using non-dict namespaces in functions

2012-03-17 Thread Eric Snow
up. Regardless, you could also implement __call__() on a function look-alike class to get what you're after. It may not be as performant though. -eric -- http://mail.python.org/mailman/listinfo/python-list

Get stack trace from C

2012-04-16 Thread Eric Frederich
can I get at the traceback text? Thanks, ~Eric -- http://mail.python.org/mailman/listinfo/python-list

Re: Get stack trace from C

2012-04-18 Thread Eric Frederich
2012 at 1:15 AM, Stefan Behnel wrote: > Eric Frederich, 16.04.2012 20:14: > > I embed Python in a 3rd party application. > > I need to use their conventions for errors. > > > > Looking here... > > http://docs.python.org/extending/embedding.html#pure-embeddin

Re: Difference between 'imp' and 'importlib'

2012-04-20 Thread Eric Snow
ferably only > one --obvious way to do it'? importlib.import_module() is the preferred approach. It's API has no direct analog in the imp module, and is easier to use. As of 3.3, importlib is used as the default import implementation for the interpreter. The imp module is quickly beco

Re: new string formatting with local variables

2011-06-06 Thread Eric Snow
trange. > > I'd like something like this: > print "{solo} was captured by {jabba}".format(locals())        # WRONG! > > But it doesn't work. > > Do you have any idea? > You were close: print "{solo} was captured by {jabba}".format(**locals()) This will turn l

how to inherit docstrings?

2011-06-08 Thread Eric Snow
, or am I "stuck" with the metaclass/class decorator route? (It's not all that bad :) Thanks! -eric p.s. Am I missing something or can you really not change the docstring of a class? I was thinking about the idea of inheriting class docstrings too. [1] http://code.activest

Re: how to inherit docstrings?

2011-06-09 Thread Eric Snow
On Thu, Jun 9, 2011 at 12:37 AM, Ben Finney wrote: > Eric Snow writes: > >> p.s. Am I missing something or can you really not change the docstring >> of a class? I was thinking about the idea of inheriting class >> docstrings too. > > The docstring of an object

Re: how to inherit docstrings?

2011-06-09 Thread Eric Snow
ven a method that doesn't > have a docstring of its own. > Auto inheriting docstrings would be nice, in some cases. WRT help(), keep in mind that docstrings are used for a bunch of other things, like doctests and some DSLs. -eric > Unfortunately, since unbound methods were ditched, >

__doc__ immutable for classes (was: Re: how to inherit docstrings?)

2011-06-09 Thread Eric Snow
On Thu, Jun 9, 2011 at 10:10 AM, Ethan Furman wrote: > Eric Snow wrote: >> >> p.s. Am I missing something or can you really not change the docstring >> of a class?  I was thinking about the idea of inheriting class >

Re: how to inherit docstrings?

2011-06-09 Thread Eric Snow
up the inheritance hierarchy >> when given a method that doesn't have a docstring of its own. > > Since the docstrings are useful in more places than just ‘help’, I'm +1 > on having docstrings be automatically inherited if not specified. > > Would the OP like to propose th

Re: how to inherit docstrings?

2011-06-09 Thread Eric Snow
-cased to be worth the trouble. I can just use a metaclass or class decorator that does that, and override builtin.__build__class__ to force its use everywhere; or use one base class for all my classes that uses the metaclass. But it would be nice to have implicit support. -eric > > Carl Banks > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list

Re: how to inherit docstrings?

2011-06-09 Thread Eric Snow
to say don't do it. With your idea you easily, clearly, and explicitly indicate that you want the inheritance activated. That would work for me. -eric > -- > Terry Jan Reedy > > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list

Re: how to inherit docstrings?

2011-06-10 Thread Eric Snow
On Fri, Jun 10, 2011 at 5:05 AM, Tim Chase wrote: > On 06/09/2011 01:22 AM, Eric Snow wrote: >> >> Sometimes when using class inheritance, I want the overriding methods >> of the subclass to get the docstring of the matching method in the >> base class.  You can do this

Re: how to inherit docstrings?

2011-06-10 Thread Eric Snow
n-empty > docstring. > > Yeah, the idea of an empty docstring to trigger docstring inheritance really appeals to me. Nice example. Incidently, aren't metaclasses always inherited, as opposed to class decorators (which are never)? -eric > > def InheritableDocstring(name, bases

Re: how to inherit docstrings?

2011-06-10 Thread Eric Snow
FYI, I started this topic up on python-ideas, as it seemed valid enough from the responses I've gotten here [1]. -eric [1] http://mail.python.org/pipermail/python-ideas/2011-June/010473.html -- http://mail.python.org/mailman/listinfo/python-list

Re: how to inherit docstrings?

2011-06-10 Thread Eric Snow
n the instance. You are right about a custom descriptor. -eric >>>> class DocDescriptor(object): > ...   def __get__(self, instance, owner): > ...     return getattr(owner, "_mydoc", None) > ... >>>> class Meta(type): > ...   def __init__(cls, name, b

Re: how to inherit docstrings?

2011-06-10 Thread Eric Snow
On Thu, Jun 9, 2011 at 12:22 AM, Eric Snow wrote: > Sometimes when using class inheritance, I want the overriding methods > of the subclass to get the docstring of the matching method in the > base class.  You can do this with decorators (after the class > definition), with class dec

break in a module

2011-06-14 Thread Eric Snow
ame__ == "__main__": name = util.get_module_name(sys.modules[__name__]) module = importlib.import_module(name) sys.modules[__name__] = module break # do my normal stuff at 0 indentation level So, any thoughts? Thanks. -eric p.s. I might just handle this with

Re: break in a module

2011-06-14 Thread Eric Snow
nsidering that other complex statements have special flow control statements, I don't see why modules shouldn't either. -eric [1] During import the module gets compiled and the result is exec'ed in the context of the __dict__ of a new ModuleType object. That module object is

Re: break in a module

2011-06-14 Thread Eric Snow
7;t really seen real code like it either. Like I said, my main motivation is to reduce my levels of indentation somewhat. I was trying to see if I could apply a pattern I use in functions and loops to modules. Things like "I have never seen..." are really helpful to hear, by the way, s

Re: os.path and Path

2011-06-16 Thread Eric Snow
This module could also include a few lines to register a particular PathFormat depending on the platform determined through sys.platform or whatever. This way your path class doesn't have to try to worry about the conversion to and from the canonical path format. -eric > > -- > Steven > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list

Using __abstractmethod__ with non-methods

2011-06-16 Thread Eric Snow
ss that using "method" in those two attribute names should change? My gut says yes to the first and no to the second, but I want to hear what you think! -eric p.s. Sorry for the length of this message. Not only do I get long-winded every once in a while but I wanted to give this a t

Re: break in a module

2011-06-16 Thread Eric Snow
a "break" in execution. Basically execution of the current frame stops and returns; loop bodies aren't handled in their own execution frames but effectively it's the same idea. So, a little namespace collision between us there on the words break and return. Regardless, for the

Re: break in a module

2011-06-16 Thread Eric Snow
eshed on the name when the merits of "breaking" out of a module's execution haven't been established, but what's the point. -eric >>>> def f(): >        yield 1 >        yield 2 >        yield 3 > > >>>> a=f() >>>> a >

performance critical Python features

2011-06-23 Thread Eric Snow
machinery behind language features like imports are moving to pure Python. So, which are the other pieces of Python that really need the heavy optimization and which are those that don't? Thanks. -eric -- http://mail.python.org/mailman/listinfo/python-list

Re: Using __abstractmethod__ with non-methods

2011-06-23 Thread Eric Snow
that Python has it wrong. On the contrary, I typically start by assuming that Python has it right and then try to figure out what I am missing. Such is the case here. -eric [1] http://mail.python.org/pipermail/python-list/2011-June/1274555.html -- http://mail.python.org/mailman/listinfo/python-list

Re: imp.find_module don't found my module but standard import statement can import this module… why ?

2011-07-05 Thread Eric Snow
is available in 2.7/3.2. A backport is available on PyPI. module = importlib.import_module("js") -eric > First, I install "js.jquery" > > $ pip install js.jquery > > Here, I would like import "js" module. > >>>> import imp

What makes functions special?

2011-07-09 Thread Eric Snow
early indicated. Are there other motivations behind code objects that I am missing? Am I wrong about the optimization expectation? Thoughts? -eric [1] http://bugs.python.org/issue12374 -- http://mail.python.org/mailman/listinfo/python-list

Re: What makes functions special?

2011-07-09 Thread Eric Snow
On Sat, Jul 9, 2011 at 4:41 PM, Ben Finney wrote: > Eric Snow writes: > >> A tracker issue [1] recently got me thinking about what makes >> functions special. > > As you describe, functions are special for your scenario because a > function definition needs to resu

Re: What makes functions special?

2011-07-09 Thread Eric Snow
On Sat, Jul 9, 2011 at 6:21 PM, Terry Reedy wrote: > On 7/9/2011 2:28 PM, Eric Snow wrote: >> >> A tracker issue [1] recently got me thinking about what makes >> functions special.  The discussion there was regarding the distinction >> between compile time (generatio

Re: What makes functions special?

2011-07-09 Thread Eric Snow
On Sat, Jul 9, 2011 at 6:38 PM, Ben Finney wrote: > Eric Snow writes: > >> On Sat, Jul 9, 2011 at 4:41 PM, Ben Finney >> wrote: >> > Eric Snow writes: >> >> No other objects have code objects. No other objects in Python have >> >> this spe

Re: What makes functions special?

2011-07-09 Thread Eric Snow
On Sat, Jul 9, 2011 at 7:34 PM, Steven D'Aprano wrote: > Eric Snow wrote: > >> Mostly I am just >> trying to put together more pieces of the Python puzzle.  In this case >> I was trying to find out if the optimized execution of code objects >> for functions i

Re: A beginning programmer

2011-07-11 Thread Eric Griffith
Shell scripts are ones that I do all the time, sometimes in BASH sometimes in python + system calls. A lot of the mainly for post-install setups of Ubuntu / Fedora / Arch trying to take some of the load off of my hands in a way that I actually know what is going on behind the scenes. But I'll defin

Re: Python Contribution

2011-07-13 Thread Eric Snow
r mentoring people that want to get started at contributing to Python: [email protected]. This a wonderful community and I hope you find the opportunity to jump right in! -eric > -- > Namashivaya, > R.Shankarraman, > Computer Science and Engineering, > Amrita

Re: Code hosting services

2011-07-13 Thread Eric Snow
oved platform over > several years ago. > Incidently, Mark Ramm of TurboGears fame went to work at SF and they have relatively recently moved a large chunk of their stuff to Python[1]. -eric [1] http://blip.tv/pycon-us-videos-2009-2010-2011/pycon-2011-scaling-python-past-100-4899197 -- http:/

Re: None versus MISSING sentinel -- request for design feedback

2011-07-15 Thread Eric Snow
hat Missing should not be re-bound... I might have said to use NotImplemented instead of None, but it can be re-bound and the name isn't as helpful for your use case. Another solution, perhaps ugly or confusing, is to use something like two underscores as the name for your sentinel: mean([1, 2, __, 3]) Still it seems like using Missing (or whatever) would be better than None. -eric > > -- > Steven > > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list

finding the object corresponding to a stack frame

2011-08-04 Thread Eric Snow
unctions. However, judging by similar questions found while researching this, I'm not holding my breath. Any ideas? -eric -- http://mail.python.org/mailman/listinfo/python-list

Re: Community Involvement

2011-08-04 Thread Eric Snow
the same time it shouldn't be anything that > places a burden on the community (otherwise the hundredth student would be > abused and the thousandth murdered). > So I wondered if anyone had any good ideas. While not as "community" as the mailing lists, perhaps they could post a

Observations on the three pillars of Python execution

2011-08-05 Thread Eric Snow
are__() (F) through inspect.currentframe().f_code.co_name Name available on object as __name__: (M) yes (C) yes (F) yes Corrections, additions, and comment are welcome. -eric -- http://mail.python.org/mailman/listinfo/python-list

Re: Observations on the three pillars of Python execution

2011-08-05 Thread Eric Snow
On Fri, Aug 5, 2011 at 8:36 AM, Steven D'Aprano wrote: > Eric Snow wrote: > >> In Python, three types of objects have special syntax and mechanics >> for their instantiation, during which a code object is generated: >> modules, classes, and functions. > >

Re: Observations on the three pillars of Python execution

2011-08-05 Thread Eric Snow
On Fri, Aug 5, 2011 at 11:29 AM, Steven D'Aprano wrote: > Eric Snow wrote: > >> On Fri, Aug 5, 2011 at 8:36 AM, Steven D'Aprano >> wrote: >>> Eric Snow wrote: >>> >>>> In Python, three types of objects have special syntax and mechanics &

how to dynamically generate __name__ for an object?

2011-08-06 Thread Eric Snow
options? Or maybe I did something wrong and it should work as I expected? -eric [1] http://hg.python.org/cpython/file/default/Objects/typeobject.c#l244 -- http://mail.python.org/mailman/listinfo/python-list

Re: how to dynamically generate __name__ for an object?

2011-08-07 Thread Eric Snow
On Sat, Aug 6, 2011 at 10:47 PM, Steven D'Aprano wrote: > Eric Snow wrote: > >> Thought I knew how to provide a dynamic __name__ on instances of a >> class.  My first try was to use a non-data descriptor: > > Perhaps you should explain what you are trying to do. If

Re: Docstrings and class Attributes

2011-08-08 Thread Eric Snow
0 Python syntax supports implicitly building docstrings only for modules, class definitions, and function definitions. -eric > > class Test (object): >    '''classx''' > >    fred = 10 >    '''attribute''' > > print

Re: Docstrings and class Attributes

2011-08-08 Thread Eric Snow
ful to me. They do show up in help(), but not as some sort of data-attribute docstring. -eric > > > > -- > Steven > > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list

Re: __set__ method is not called for class attribute access

2011-08-10 Thread Eric Snow
metaclass=XMeta): "Do your stuff." They you would put your descriptor hacking in XMeta and still take advantage of the original metaclass. -eric > > Michael Foord > -- > http://voidspace.org.uk/ > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list

Re: how to dynamically generate __name__ for an object?

2011-08-10 Thread Eric Snow
On Wed, Aug 10, 2011 at 8:48 AM, Fuzzyman wrote: > On Aug 7, 4:06 am, Eric Snow wrote: >> Thought I knew how to provide a dynamic __name__ on instances of a >> class.  My first try was to use a non-data descriptor: >> >> # module base.py >> >> class _Name

code object differences between 2.7 and 3.3a

2011-08-10 Thread Eric Snow
', 'args', 'kwargs', 'b', 'c') While there are several differences, the one I care about is co_name. For 2.7 it's what I would expect. However, for 3.3 it's not[2][3]. It is actually nicer for my application this way, but I want to verify the situa

Re: 'super' object has no attribute '__setitem__'

2011-08-18 Thread Eric Snow
__ instead? object, the base class of HistoryKeeper, does not have a __setitem__ method, hence the AttributeError. super() is a proxy for the next class in the MRO, typically the base class of your class. Keep in mind that is equivalent to . However, is equivalent to . see: http://docs.python

Windows No-Install Distribution?

2011-08-23 Thread Eric Lemings
by copying files from one system to another? If so, does such a "no-install" distribution already exist? If not, what are the minimum set of Python 3.x files from a standard Windows Python installation required for proper/normal operation? Thanks, Eric. -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows No-Install Distribution?

2011-08-23 Thread Eric Lemings
On Aug 23, 9:31 am, Redcat wrote: > I haven't tried it myself yet, but mighthttp://www.portablepython.com/ > be what you're looking for? Almost except it contains additional Python packages that I'm not interested in. -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows No-Install Distribution?

2011-08-23 Thread Eric Lemings
On Aug 23, 1:52 pm, Stephen Hansen wrote: > On 8/23/11 8:29 AM, Eric Lemings wrote: > > > I would like to create/find a Python 3.x distribution that can be > > redeployed simply by copying a directory of required files; i.e. > > Just take the default installer, instal

Re: Why do class methods always need 'self' as the first parameter?

2011-08-31 Thread Eric Snow
emistry set - "what happens > if I mix a little of everything together?"... First thing that comes to mind is calling a base class's implementation of a method: class X(Y): def __init__(self, value): Y.__init__(self) self.value = value -eric > > ChrisA &

Re: PEP 20 - Silly Question?

2011-09-06 Thread Eric Snow
n: http://mail.python.org/pipermail/python-list/1999-June/616160.html (from http://www.wefearchange.org/2010/06/import-this-and-zen-of-python.html) -eric > Thank You, > Joseph Armbruster > > -- > http://mail.python.org/mailman/listinfo/python-list > > -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for open-source Python projects to help out with

2011-09-07 Thread Eric Snow
-ext/issues/list Basically it's adding an extensions framework to the stdlib unittest module. I'm sure Michael Foord wouldn't mind the help. Like I said, a very interesting project, though not directly related to accessibility or security. -eric > > -- > > Take car

embedding interactive python interpreter

2011-03-25 Thread Eric Frederich
ed. I need to embed python in an application that needs to do some cleanup at the end so I need that code to execute. What am I doing wrong? Is there something else I should call besides "exit()" from within the interpreter? Is there something other than Py_Main that I should be calling? Thanks, ~Eric -- http://mail.python.org/mailman/listinfo/python-list

Re: embedding interactive python interpreter

2011-03-25 Thread Eric Frederich
to pass a value back from the interpreter via sys.exit. Thanks, ~Eric On Fri, Mar 25, 2011 at 12:02 PM, Eric Frederich wrote: > I am able to embed the interactive Python interpreter in my C program > except that when the interpreter exits, my entire program exits. > >    #include >

Re: embedding interactive python interpreter

2011-03-25 Thread Eric Frederich
Added a fflush(stdout) after each printf and, as I expectedstill only the first 2 prints. On Fri, Mar 25, 2011 at 1:47 PM, MRAB wrote: > On 25/03/2011 17:37, Eric Frederich wrote: >> >> So I found that if I type ctrl-d then the other lines will print. >> >>

Re: embedding interactive python interpreter

2011-03-27 Thread Eric Frederich
This is behavior contradicts the documentation which says the value passed to sys.exit will be returned from Py_Main. Py_Main doesn't return anything, it just exits. This is a bug. On Sun, Mar 27, 2011 at 3:10 AM, Mark Hammond wrote: > On 26/03/2011 4:37 AM, Eric Frederich wrote: >

Re: embedding interactive python interpreter

2011-03-27 Thread Eric Frederich
ot; or "sys.exit(123)". I cannot call any of my C cleanup code because of this. On Sun, Mar 27, 2011 at 1:55 PM, Jerry Hill wrote: > On Sun, Mar 27, 2011 at 9:33 AM, Eric Frederich > wrote: >> This is behavior contradicts the documentation which says the value >>

Re: embedding interactive python interpreter

2011-03-27 Thread Eric Frederich
: > On Friday, March 25, 2011 12:02:16 PM UTC-4, Eric Frederich wrote: >> >> Is there something else I should call besides "exit()" from within the >> interpreter? >> Is there something other than Py_Main that I should be calling? > > Does PyRun_Interactive

Re: TypeError: iterable argument required

2011-04-06 Thread Eric Snow
n.org/library/stdtypes.html#truth-value-testing>-eric 2011/4/6 Νικόλαος Κούρας > >>> mail = None > >>> mail = mail or 7 > >>> mail > 7 > > >>> mail = None > >>> mail = 7 or mail > >>> mail > 7 > > Here

Re: python on iPad (PyPad)

2011-04-08 Thread Eric Snow
On Fri, Apr 8, 2011 at 11:13 PM, Jon Dowdall wrote: > Hi All, > > Sorry for the blatant advertising but hope some of you may be interested > to know that I've created an iPad application containing the python > interpreter and a simple execution environment. It's available in iTunes > at http://it

Re: python on iPad (PyPad)

2011-04-09 Thread Eric Snow
On Fri, Apr 8, 2011 at 11:13 PM, Jon Dowdall wrote: > Hi All, > > Sorry for the blatant advertising but hope some of you may be interested > to know that I've created an iPad application containing the python > interpreter and a simple execution environment. It's available in iTunes > at http://it

Re: Nested inner classes and inheritance -> namespace problem

2011-04-13 Thread Eric Snow
class InnerSubclass(Inner): nonlocal Inner class Worker(Inner.Worker): pass return Outer That would pull Inner into the namespace of InnerSubclass, allowing Worker to use it in the bases declaration. If you really want to get crazy, I suppose you could do so metaclass hackery... -eric > Thanks, > > > *larry* > ** > > -- > http://mail.python.org/mailman/listinfo/python-list > > -- http://mail.python.org/mailman/listinfo/python-list

PEP index by topic

2011-04-14 Thread Eric Snow
love to see an index like this in PEP 1, but it may not be practical, as the topics in the index can grow pretty dynamically. Maybe a snapshot of the wiki content could be added to PEP 1? Or maybe just a link there to the wiki page? Regardless, I hope everyone finds a topical PEP inde

installing setuptools on Windows custom python install

2011-04-18 Thread Eric Frederich
Hello, I have a python installation that I built myself using Visual Studio 2005. I need this version because I need to link Python bindings to a 3rd party library that uses VS 2005. I want to get setuptools installed to this Python installation but the installer won't find my version of Python e

Re: installing setuptools on Windows custom python install

2011-04-19 Thread Eric Frederich
his file would the socket library then be built into the main dll file? I'm not sure exactly how to use this config.c file. Thanks, ~Eric On Mon, Apr 18, 2011 at 2:30 PM, Wolfgang Rohdewald wrote: > On Montag 18 April 2011, Eric Frederich wrote: >>   File "F:\My_Python27\lib\s

multiple Python 2.7 Windows installations

2011-04-19 Thread Eric Frederich
lease? Thanks, ~Eric -- http://mail.python.org/mailman/listinfo/python-list

NaN

2011-04-28 Thread Eric Snow
not clear: 1. Why is NaN not an exception? (not "why not change it to one?" Changing it now would probably break stuff.) 2. What are the use cases for NaN? Looks like it gets used a lot as a numeric (float?) object with non-value. Any clarification would be really helpful. Tha

Re: NaN

2011-04-28 Thread Eric Snow
On Thu, Apr 28, 2011 at 11:01 AM, Chris Rebert wrote: > On Thu, Apr 28, 2011 at 9:21 AM, Eric Snow > wrote: > > There's a big discussion going on at python-dev and python-ideas about > NaN > > (not-a-number, from IEEE 754). I haven't really gotten into any > s

Re: Composition instead of inheritance

2011-04-28 Thread Eric Snow
But generally that would help bridge the inheritance gap for isinstance cases. -eric p.s. I would have commented on the recipe but could not log in... -- http://mail.python.org/mailman/listinfo/python-list

Re: checking if a list is empty

2011-05-06 Thread Eric Snow
list empty (length 0) or is the boolean version false? Again, for lists these are the same. For list-like classes they are not necessarily the same. Incidently, you can also check "if li == []:". This will let the __eq__ operator jump in. -eric [1] http://docs.python.org/dev/py3k/re

Re: checking if a list is empty

2011-05-11 Thread Eric Snow
at I needed to look it up. I do know that the builtin list has a __eq__ method and a __len__ method, but not a __bool__ method (which it doesn't need [3]). -eric [1] http://docs.python.org/dev/py3k/reference/compound_stmts.html#the-if-statement [2] http://docs.python.org/dev/py3k/referen

Re: list equal to subclass of list?

2011-05-12 Thread Eric Snow
ny of the builtin types have custom special methods for a variety of operators, including comparison. Looking over the documentation, it seems like it could be touched up to alleviate any confusion. Perhaps rewording to make it clear that the described behavior is the default for objects,

Re: How best to convert a string "list" to a python list

2011-05-13 Thread Eric Snow
t color_list >print x + "\n" > > color_list.append(x) # append last color left in x (no sc at end of > string) > print color_list > > print "done" > -- > http://mail.python.org/mailman/listinfo/python-list > Try the following: color_list = x.split(&

portable multiprocessing code

2011-05-17 Thread Eric Frederich
I have written some code using Python 2.7 but I'd like these scripts to be able to run on Red Hat 5's 2.4.3 version of Python which doesn't have multiprocessing. I can try to import multiprocessing and set a flag as to whether it is available. Then I can create a Queue.Queue instead of a multiproc

Re: Python 3 vs Python 2.7 dilemma

2011-05-17 Thread Eric Snow
es transition the remaining ones have less reason to stay on Python 2. The anticipation was to see everyone on Python 3 by 5 years after its release. It was released just over 2.5 years ago. Here are some references that you might find helpful: http://wiki.python.org/moin/Python2orPython3 http:

validating a class against an ABC at definition time

2011-05-19 Thread Eric Snow
that programmatically. Does anyone know a better way to do ABC validation at definition time? Thanks. -eric -- http://mail.python.org/mailman/listinfo/python-list

ABC validation strictly on an instance

2011-05-20 Thread Eric Snow
However, they mostly seem like overkill to me. I have included them below. If anyone has ideas on how to approach the problem of using an ABC but satisfying it with instance names, I would love to hear it. Thanks! -eric [1] In this case it would be nice to know at definition time that the c

Re: validating a class against an ABC at definition time

2011-05-20 Thread Eric Snow
On Thu, May 19, 2011 at 11:33 PM, Eric Snow wrote: > Thinking about class APIs and validating a class against an API. The abc > module provides the tools to do some of this. One thing I realized, that I > hadn't noticed before, is that the abstractness of a class is measured when

Re: validating a class against an ABC at definition time

2011-05-20 Thread Eric Snow
On Fri, May 20, 2011 at 4:55 PM, Eric Snow wrote: > > I have revised this and made a recipe for it: > > > http://code.activestate.com/recipes/577711-validating-classes-and-objects-against-an-abstract/ > > I also added this: http://code.activestate.com/recipes/577712-add

Re: super() in class defs?

2011-05-25 Thread Eric Snow
it has its place). Personally, I find super to make maintenance and refactoring easier, since I don't have to fiddle with the base class name, or with passing self. Cheers, -eric > http://fuhm.net/super-harmful/ > > Cheers, > Ian > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's super() considered super!

2011-05-27 Thread Eric Snow
;def last_item(self): >return list.last_item(self) + 1 > > > I was thrilled to learn a new trick, popping keyword arguments before > calling super, and wondered why I hadn't thought of that myself. How on > earth did I fail to realise that a kwarg dict was mut

returning NotImplemented

2011-05-31 Thread Eric Snow
there a good way to tell the difference, or would it be good practice to always handle explicitly in a function any exception type that you may be raising there? Thanks, -eric [1] http://hg.python.org/cpython/file/29e08a98281d/Lib/collections/abc.py#l398 [2] http://bugs.python.org/issue8729 [

Re: returning NotImplemented

2011-05-31 Thread Eric Snow
On Tue, May 31, 2011 at 3:46 PM, Eric Snow wrote: > Looking at the ABC code [1], I noticed that Mapping's __eq__ method can > return NotImplemented. This got me curious as to why you would return > NotImplemented and not raise a TypeError or a NotImplementedError. > >

Re: returning NotImplemented

2011-05-31 Thread Eric Snow
On Tue, May 31, 2011 at 4:18 PM, Ethan Furman wrote: > Eric Snow wrote: > >> Looking at the ABC code [1], I noticed that Mapping's __eq__ method can >> return NotImplemented. This got me curious as to why you would return >> NotImplemented and not raise a TypeE

Re: returning NotImplemented

2011-05-31 Thread Eric Snow
On Tue, May 31, 2011 at 6:30 PM, Ethan Furman wrote: > Eric Snow wrote: > >> Guido indicates earlier in the thread that NotImplemented is used so that >> you know that it came from the function that you directly called, and not >> from another call inside that function.

Re: [python-committers] Welcome the 3.8 and 3.9 Release Manager - Łukasz Langa!

2018-01-27 Thread Eric Snow
On Sat, Jan 27, 2018 at 2:02 PM, Barry Warsaw wrote: > please welcome your next release manager… > > Łukasz Langa! Congrats, Łukasz! (or condolences? ) -eric -- https://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] Small lament...

2023-04-01 Thread Eric Fahlgren
Oh, man, it has been a while. The last one I remember is PEP 404 (if you can find it :) ), dated 2011 and it wasn't an April Fool's... On Sat, Apr 1, 2023 at 11:23 AM Skip Montanaro wrote: > Just wanted to throw this out there... I lament the loss of waking up on > April 1st to see a creative A

Re: Request for help

2016-07-18 Thread Eric kago
Hi Pythoners I need help in understanding hoe to put up the code to the following command - Create a constructor that takes in an integer and assigns this to a `balance` property Regards, Eric Kago +254(0)714249373 Nairobi Kenya -- https://mail.python.org/mailman/listinfo/python

<    1   2   3   4   5   6   7   8   9   10   >