Re: Future of Pypy?

2015-02-22 Thread Ryan Stuart
On Mon Feb 23 2015 at 12:05:46 PM Paul Rubin wrote: > I don't see what the big deal is. I hear tons of horror stories about > threads and I believe them, but the thing is, they almost always revolve > around acquiring and releasing locks in the wrong order, forgetting to > lock things, stuff lik

Re: Future of Pypy?

2015-02-22 Thread Ryan Stuart
On Mon Feb 23 2015 at 1:50:40 PM Paul Rubin wrote: > That article is about the hazards of mutable state shared between > threads. The key to using threads safely is to not do that. So the > "transfer" example in the article would instead be a message handler in > the thread holding the account

Re: Future of Pypy?

2015-02-22 Thread Ryan Stuart
On Mon Feb 23 2015 at 4:15:42 PM Paul Rubin wrote: > > What do you mean about Queues working with processes? I meant > Queue.Queue. There is multiprocessing.Queue but that's much less > capable, and it uses cumbersome IPC like pipes or sockets instead of a > lighter weight lock. Threads can als

Re: Are threads bad? - was: Future of Pypy?

2015-02-24 Thread Ryan Stuart
On Tue Feb 24 2015 at 3:32:47 PM Paul Rubin wrote: > Ryan Stuart writes: > Sure, the shared memory introduces the possibility of some bad errors, > I'm just saying that I've found that by staying with a certain > straightforward style, it doesn't seem difficult i

Re: How to begin

2014-02-13 Thread Ryan Gonzalez
ce. I know it's long, but it saves you trouble of accidentally reinventing the wheel. -- --Ryan If anybody ever asks me why I prefer C++ to C, my answer will be simple: "It's becauseslejfp23(@#Q*(E*EIdc-SEGFAULT. Wait, I don't think that was nul-terminated." -- https

Re: Explanation of list reference

2014-02-14 Thread Ryan Gonzalez
|x = [1,2,3] x = [4,5,6] | x now points to a different memory location. And, when you do this: |x[0] =99000 x[0] =100 | you're just changing the memory location that |x[0]| points to. -- --Ryan If anybody ever asks me why I prefer C++ to C, my answer will be simple: "It's becaus

Re: How to begin

2014-02-14 Thread Ryan Gonzalez
Ack, I meant that, not the whole reference. On Thu, Feb 13, 2014 at 6:57 PM, Ben Finney wrote: > Ryan Gonzalez writes: > > > Read the Python reference. I know it's long, but it saves you trouble > > of accidentally reinventing the wheel. > > Hmm, the language re

Re: How to turn a package into something pip can install

2014-02-14 Thread Ryan Gonzalez
his? > -- > https://mail.python.org/mailman/listinfo/python-list > -- Ryan If anybody ever asks me why I prefer C++ to C, my answer will be simple: "It's becauseslejfp23(@#Q*(E*EIdc-SEGFAULT. Wait, I don't think that was nul-terminated." -- https://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] [RELEASED] Python 3.4.0

2014-03-17 Thread Ryan Gonzalez
://bugs.python.org/ > > > Enjoy! > > > -- > Larry Hastings, Release Manager > larry at hastings.org > (on behalf of the entire python-dev team and 3.4's contributors) > ___ > Python-Dev mailing list > python-...@python.org > https://mail.pyt

Ideas for Python 4

2014-04-01 Thread Ryan Gonzalez
t;>>m3->>>m4!!;; -- Call m2, then m3, then m4, then return the resulting object -- BTW, April Fools! This is ugly... -- Ryan If anybody ever asks me why I prefer C++ to C, my answer will be simple: "It's becauseslejfp23(@#Q*(E*EIdc-SEGFAULT. Wait, I don't think that

[ANN] ClamAV for Python 0.2!

2014-04-06 Thread Ryan Gonzalez
av-python>. Report bugs to the Issue tracker <https://github.com/kirbyfan64/clamav-python/issues>. -- Ryan If anybody ever asks me why I prefer C++ to C, my answer will be simple: "It's becauseslejfp23(@#Q*(E*EIdc-SEGFAULT. Wait, I don't think that was nul-terminated.&quo

Re: Why Python 3?

2014-04-18 Thread Ryan Hiebert
If you are starting a new project, I'd highly encourage you to use Python 3. It is a stable, well supported, and beautiful language, and gives you the full power of the innovation that is current in the Python world. Python 2 is still well supported (for a while to come), but you won't have the sam

Re: Installing PyGame?

2014-04-24 Thread Ryan Hiebert
On Thu, Apr 24, 2014 at 9:38 PM, Ned Deily wrote: > In article , > Gregory Ewing wrote: > > My advice would be to steer clear of things like Fink and MacPorts > > and do things the native MacOSX way wherever possible. That means > > using a framework installation of Python and framework version

Re: Significant digits in a float?

2014-04-29 Thread Ryan Hiebert
On Tue, Apr 29, 2014 at 3:16 PM, Adam Funk wrote: > > "A man pitches his tent, walks 1 km south, walks 1 km east, kills a > bear, & walks 1 km north, where he's back at his tent. What color is > the bear?" ;-) Skin or Fur? -- https://mail.python.org/mailman/listinfo/python-list

Re: Off-topic circumnavigating the earth in a mile or less [was Re: Significant digits in a float?]

2014-04-30 Thread Ryan Hiebert
On Wed, Apr 30, 2014 at 9:02 AM, Ethan Furman wrote: > On 04/30/2014 06:14 AM, Ethan Furman wrote: > >> On 04/29/2014 03:51 PM, Chris Angelico wrote: >> >>> On Wed, Apr 30, 2014 at 8:42 AM, emile wrote: >>> On 04/29/2014 01:16 PM, Adam Funk wrote: "A man pitches his tent, walks 1

Re: HELP!! How to ask a girl out with a simple witty Python code??

2015-03-04 Thread Ryan Stuart
On Thu, 5 Mar 2015 at 11:35 Xrrific wrote: > Could you please come up with something witty incorporating a simple > python line like If...then... but..etc. > Send her this: import base64 print(base64.b64decode('CkhpLCAKVGhpcyBpcyBzb21lb25lIGZyb20gdGhlIHB5dGhvbiBtYWlsaW5nIGxpc3QuIFRoaXMgZ3V5ICho

My emails are getting bounced?

2015-03-12 Thread Ryan Gonzalez
tting bounce_notify_owner_on_disable to Yes. This will cause Mailman to send the triggering bounce to the owner, but since that's you, it may bounce too. Is it possible for someone to set this up for my email on Python-ideas? Again, not sure who the manager is, so I'm sending this here. -- Ryan [ERROR]:

Re: test2

2015-03-24 Thread Ryan Stuart
rch$', gui_search), > # (r'^delete/$', ipdb_input_delete), > (r'^api/add/$', api_add), #check sensornet urls.py and > views/sensors.py for cool tricks. > (r'^api/search/$', api_search), #check sensornet urls.py and > views/sensors.py for cool tricks. > (r'^api/file/$', api_file), > > #(r'^asset/media/(?P.*)$', 'django.views.static.serve', > {'document_root': os.path.join(PROJECT_PATH, '../asset/media')}), > > #(r'^ip_db/media/(?P.*)$', 'django.views.static.serve', > {'document_root': os.path.join(PROJECT_PATH, 'ip_db/media')}), > #(r'^media/(?P.*)$', 'django.views.static.serve', > {'document_root': os.path.join(PROJECT_PATH, 'media')}), > #(r'^static/(?P.*)$', 'django.views.static.serve', > {'document_root': '/home/sensornet/static'}), > > # extjs4 stuff > #(r'^asset/overview/extjs/(?P.*)$', 'serve', {'document_root': > os.path.join(PROJECT_PATH, '../asset/extjs')}), > #(r'^extjs/(?P.*)$', 'django.views.static.serve', > {'document_root': os.path.join(PROJECT_PATH, '../ip_db/extjs')}), > #(r'^extjs/(?P.*)$', 'django.views.static.serve', > {'document_root': '/home/totis/tree/ipdb/django/ipdb/asset/static/extjs'}), > ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT), > 'ipdb.asset': { > 'handlers': ['console', 'logfile'], > 'level': 'DEBUG', > }, > } > } > > === > > > > -- > https://mail.python.org/mailman/listinfo/python-list > -- Ryan Stuart, B.Eng Software Engineer ABN: 81-206-082-133 W: http://www.textisbeautiful.net/ M: +61-431-299-036 -- https://mail.python.org/mailman/listinfo/python-list

Re: Parser needed.

2015-06-09 Thread Ryan Stuart
tine is real nice... to get rid of fudd/white space... and > just tokens which is nice. > > So for now I will use that as my tokenizer ;) =D > > and bracket level counting and sections and stuff like that yeah... > > > Bye, > Skybuck. > -- > https://mail.python.org/mailman/listinfo/python-list > -- Ryan Stuart, B.Eng Software Engineer ABN: 81-206-082-133 W: http://www.textisbeautiful.net/ M: +61-431-299-036 -- https://mail.python.org/mailman/listinfo/python-list

Stripping sRGB profile from PNGs in python

2015-07-23 Thread Ryan Holmes
We're getting this error when trying to load some of out projects images: libpng warning: iCCP: known incorrect sRGB profile The source files that we have some with incorrect sRGB profiles. We don't have control over the source files, but what we normally do is take them and scale them d

Re: [Python-ideas] Wheels For ...

2015-09-06 Thread Ryan Gonzalez
On September 6, 2015 12:33:29 PM CDT, "Sven R. Kunze" wrote: >Hi folks, > >currently, I came across http://pythonwheels.com/ during researching >how >to make a proper Python distribution for PyPI. I thought it would be >great idea to tell other maintainers to upload their content as wheels >s

Re: Sqlite pragma statement "locking_mode" set to "EXCLUSIVE" by default

2015-09-21 Thread Ryan Stuart
ion of it being a compile time PRAGMA. Cheers > > There is some performance to be gained. I have a number of python scripts, > and don't want to alter the pragma statement for every script. This > computer never writes to the databases. > > thank you > > -- > https://mail

Re: Sqlite pragma statement "locking_mode" set to "EXCLUSIVE" by default

2015-09-22 Thread Ryan Stuart
gt; > On Tue, Sep 22, 2015 at 2:04 PM, Ryan Stuart > wrote: > >> On Thu, Sep 17, 2015 at 2:24 PM, sol433tt wrote: >> >>> I would like to have the Sqlite pragma statement "locking_mode" set to >>> "EXCLUSIVE" by default (RO database). Does thi

Re: Unicode and Python - how often do you index strings?

2014-06-05 Thread Ryan Hiebert
2014-06-05 13:42 GMT-05:00 Johannes Bauer : > On 05.06.2014 20:16, Paul Rubin wrote: > > Johannes Bauer writes: > >> line = line[:-1] > >> Which truncates the trailing "\n" of a textfile line. > > > > use line.rstrip() for that. > > rstrip has different functionality than what I'm doing. How so

Re: Unicode and Python - how often do you index strings?

2014-06-05 Thread Ryan Hiebert
On Thu, Jun 5, 2014 at 2:59 PM, Chris Angelico wrote: > On Fri, Jun 6, 2014 at 4:52 AM, Ryan Hiebert wrote: > > 2014-06-05 13:42 GMT-05:00 Johannes Bauer : > > > >> On 05.06.2014 20:16, Paul Rubin wrote: > >> > Johannes Bauer writes: > >> &g

Re: None in string => TypeError?

2014-06-09 Thread Ryan Hiebert
On Mon, Jun 9, 2014 at 10:34 AM, Roy Smith wrote: > We noticed recently that: > > >>> None in 'foo' > > raises (at least in Python 2.7) > > TypeError: 'in ' requires string as left operand, not NoneType > > This is surprising. > > It's the same in 3.4, and I agree that it's surprising, at least t

Re: Python ORM library for distributed mostly-read-only objects?

2014-06-23 Thread Lie Ryan
On 22/06/14 10:46, smur...@gmail.com wrote: I've been doing this with a "classic" session-based SQLAlchemy ORM, approach, but that ends up way too slow and memory intense, as each thread gets its own copy of every object it needs. I don't want that. If you don't want each thread to have thei

Re: Python ORM library for distributed mostly-read-only objects?

2014-06-23 Thread Lie Ryan
On 23/06/14 19:05, smur...@gmail.com wrote: On Monday, June 23, 2014 5:54:38 PM UTC+2, Lie Ryan wrote: If you don't want each thread to have their own copy of the object, Don't use thread-scoped session. Use explicit scope instead. How would that work when multiple threads trave

Re: Single underscore in interactive mode

2014-06-25 Thread Lie Ryan
On 25/06/14 16:20, candide wrote: As explained by the docs, an assignment statement_evaluates_ the expression on the right hand side. So we can deduce that at the very beginning of the 2nd prompt, "the result of the last evaluation" is 43. Nevertheless, calling _ raises a NameError exception

Re: PEP8 and 4 spaces

2014-07-04 Thread Lie Ryan
On 04/07/14 07:55, Gregory Ewing wrote: Steven D'Aprano wrote: That's exactly the problem with tabs - whatever you think your code looks like with tabs, other people will see quite different picture. Why do you consider this a problem? It's a problem if you try to use tabs for lining things

How to install and run a script?

2014-10-12 Thread Ryan Shuell
I'm an absolute noob to Python, although I have been programming in several other languages for over 10 years. I'm trying to install and run some scripts, and I'm not having much success. I followed the steps at this site. https://docs.python.org/2/install/ I have Python 2.7.6 Shell. If I type

Re: Quick Question About Setting Up Pytz

2014-10-20 Thread Ryan Shuell
Ok, thanks everyone. I just need to spend more time with this stuff. It's definitely slow going. On Sat, Oct 18, 2014 at 11:16 PM, Rustom Mody wrote: > On Sunday, October 19, 2014 8:25:53 AM UTC+5:30, Ben Finney wrote: > > Chris Angelico writes: > > > > Try learning Python itself, rather than

Re: Question about PANDAS

2014-10-20 Thread Ryan Shuell
Thanks guys. I just feel frustrated that I can't do something useful. I'm reading all about dictionaries, and types, and touples. Then I read about string manipulation and loops; two of my favorite things to do. Then I read about logic: -719 >= 833 False That's great, but it's just not very use

Re: cause __init__ to return a different class?

2011-09-14 Thread Ryan Kelly
ual is going on: obj = MyBaseClass.get_random_subclass() While this hides the intention of the code and would require additional documentation or comments: obj = MyBaseClass() # note: actually returns a subclass! Just a thought :-) Cheers, Ryan -- Ryan Kelly htt

Re: Dynamically creating properties?

2011-10-27 Thread Lie Ryan
On 10/28/2011 08:48 AM, DevPlayer wrote: On Oct 27, 3:59 pm, Andy Dingley wrote: I have some XML, with a variable and somewhat unknown structure. I'd like to encapsulate this in a Python class and expose the text of the elements within as properties. How can I dynamically generate properties (

Re: How to mix-in __getattr__ after the fact?

2011-10-28 Thread Lie Ryan
On 10/29/2011 05:20 AM, Ethan Furman wrote: Python only looks up __xxx__ methods in new-style classes on the class itself, not on the instances. So this works: 8< class Cow(object): pass def attrgetter(self, a): print "CAUGHT: At

Re: Convert DDL to ORM

2011-10-29 Thread Lie Ryan
On 10/25/2011 03:30 AM, Alec Taylor wrote: Good morning, I'm often generating DDLs from EER->Logical diagrams using tools such as PowerDesigner and Oracle Data Modeller. I've recently come across an ORM library (SQLalchemy), and it seems like a quite useful abstraction. Is there a way to conve

Re: How to mix-in __getattr__ after the fact?

2011-11-07 Thread Lie Ryan
On 10/31/2011 11:01 PM, dhyams wrote: Thanks for all of the responses; everyone was exactly correct, and obeying the binding rules for special methods did work in the example above. Unfortunately, I only have read-only access to the class itself (it was a VTK class wrapped with SWIG), so I had

Re: Python ORMs Supporting POPOs and Substituting Layers in Django

2011-11-07 Thread Lie Ryan
On 11/08/2011 01:21 PM, Travis Parks wrote: On Nov 7, 12:44 pm, John Gordon wrote: In John Gordon writes: In<415d875d-bc6d-4e69-bcf8-39754b450...@n18g2000vbv.googlegroups.com> Travis Parks writes: Which web frameworks have people here used and which have they found to be: scalable, RAD

Re: Question about 'iterable cursors'

2011-11-07 Thread Lie Ryan
On 11/07/2011 05:04 PM, John Nagle wrote: Realize that SQLite is not a high-performance multi-user database. You use SQLite to store your browser preferences, not your customer database. I agree with SQLite is not multi-user; I disagree that SQLite is not a high-performance database. In single

Re: order independent hash?

2011-12-04 Thread Lie Ryan
On 12/02/2011 03:29 PM, 8 Dihedral wrote: I clear my point a hash is a collection of (key, value) pairs that have well defined methods and behavior to be used in programming. The basic operations of a hash normally includes the following: 1. insertion of a (key, value) pair into the hash

Re: order independent hash?

2011-12-04 Thread Lie Ryan
On 12/02/2011 04:48 PM, 8 Dihedral wrote: On Friday, December 2, 2011 1:00:10 PM UTC+8, Chris Angelico wrote: On Fri, Dec 2, 2011 at 3:29 PM, 8 Dihedral wrote: I clear my point a hash is a collection of (key, value) pairs that have well defined methods and behavior to be used in progr

Re: order independent hash?

2011-12-04 Thread Lie Ryan
On 12/05/2011 11:52 AM, 8 Dihedral wrote: On Monday, December 5, 2011 7:24:49 AM UTC+8, Ian wrote: On Sun, Dec 4, 2011 at 4:17 PM, 8 Dihedral wrote: Please explain what you think a hash function is, then. Per Wikipedia, "A hash function is any algorithm or subroutine that maps large

Re: 70% [* SPAM *] multiprocessing.Queue blocks when sending large object

2011-12-05 Thread Lie Ryan
On 11/30/2011 06:09 AM, DPalao wrote: Hello, I'm trying to use multiprocessing to parallelize a code. There is a number of tasks (usually 12) that can be run independently. Each task produces a numpy array, and at the end, those arrays must be combined. I implemented this using Queues (multiproce

Re: Fwd: class print method...

2011-12-05 Thread Lie Ryan
On 12/05/2011 10:18 PM, Suresh Sharma wrote: Pls help its really frustrating -- Forwarded message -- From: Suresh Sharma Date: Monday, December 5, 2011 Subject: class print method... To: "d...@davea.name " mailto:d...@davea.name>> Dave, Thanx for the qui

Re: Install Python on Windows without Start Menu icons?

2011-12-05 Thread Lie Ryan
On 12/05/2011 07:01 PM, Wolfgang Strobl wrote: "Pedro Henrique G. Souto": On 02/12/2011 16:34, snorble wrote: Is it possible to automate the Python installation on Windows using the MSI file so it does not add a Start Menu folder? I would like to push out Python to all of my office workstation

Re: Need some IPC pointers

2011-12-08 Thread Lie Ryan
On 12/01/2011 08:03 AM, Andrew Berg wrote: I've done some research, but I'm not sure what's most appropriate for my situation. What I want to do is have a long running process that spawns processes (that aren't necessarily written in Python) and communicates with them. The children can be spawned

Re: Misleading error message of the day

2011-12-08 Thread Lie Ryan
On 12/09/2011 07:13 AM, Ethan Furman wrote: Jean-Michel Pichavant wrote: You have to opportunity to not use unpacking anymore :o) There is a recent thread were the dark side of unpacking was exposed. Unpacking is a cool feautre for very small applications but should be avoided whenever possible

Re: subprocess.Popen under windows 7

2011-12-08 Thread Lie Ryan
On 12/09/2011 09:41 AM, Frank van den Boom wrote: What can I do, to prevent pressing the return key? I didn't have Windows 7 right now, but that shouldn't happen with the code you've given; when trimming code for posting, you should check that the trimmed code still have the exact same proble

Re: Misleading error message of the day

2011-12-10 Thread Lie Ryan
On 12/09/2011 03:57 PM, alex23 wrote: On Dec 9, 11:46 am, Lie Ryan wrote: perhaps the one that talks about `a, a.foo = 1, 2` blowing up? Are you sure you're not confusing this with the recent thread on 'x = x.thing = 1'? Ah, yes I do -- http://mail.python.org/mailman/listinfo/python-list

Re: order independent hash?

2011-12-10 Thread Lie Ryan
On 12/09/2011 10:27 PM, Steven D'Aprano wrote: On Thu, 08 Dec 2011 10:30:01 +0100, Hrvoje Niksic wrote: In a language like Python, the difference between O(1) and O(log n) is not the primary reason why programmers use dict; they use it because it's built-in, efficient compared to alternatives,

Re: order independent hash?

2011-12-10 Thread Lie Ryan
On 12/11/2011 11:17 AM, Chris Angelico wrote: On Sun, Dec 11, 2011 at 10:58 AM, Lie Ryan wrote: On 12/09/2011 10:27 PM, Steven D'Aprano wrote: Except for people who needed dicts with tens of millions of items. who should be using a proper DBMS in any case. Not necessarily. &quo

Re: AttributeError in "with" statement (3.2.2)

2011-12-14 Thread Lie Ryan
On 12/15/2011 03:56 AM, Eric Snow wrote: On Tue, Dec 13, 2011 at 11:05 PM, Eric Snow wrote: If you want to be more dynamic about it you can do it, but it involves black magic. Chances are really good that being explicit through your class definition is the right approach. Note that the black

Re: Make a small function thread safe

2011-12-16 Thread Lie Ryan
On 12/17/2011 01:30 AM, Brad Tilley wrote: Or perhaps run should look like this instead: def run(t): lock.acquire() shared_container.append(t.name ) lock.release() That seems a bit barbaric to me, not sure. change that to: def run(t): with l

Re: root[:]=[root,root]

2011-12-16 Thread Lie Ryan
On 12/17/2011 01:40 PM, YAN HUA wrote: Hi,all. Could anybody tell how this code works? >>> root = [None, None] First, you're creating a list of two None, let's say it's list-1. Then you bind the name 'root' to list-1. >>> root[:] = [root, root] Next, you assign list-1's first member wit

Re: how to run python-script from the python promt? [absolute newbie]

2011-12-18 Thread Lie Ryan
On 12/18/2011 10:00 PM, nukeymusic wrote: How can I load a python-script after starting python in the interactive mode? I tried with load 'myscript.py' myscript.py myscript but none of these works, so the only way I could work further until now was copy/paste line per line of my python-script

Re: calculate difference between two timestamps [newbie]

2011-12-18 Thread Lie Ryan
On 12/18/2011 10:43 PM, Peter Otten wrote: nukeymusic wrote: On 17 dec, 12:20, "Günther Dietrich" wrote: nukeymusic wrote: I'm trying to calculate the difference in seconds between two [...] import datetime date1 = datetime.datetime.strptime("Dec-13-09:47:12", "%b-%d-%H:%M:%S") date2 =

Re: how to run python-script from the python promt? [absolute newbie]

2011-12-19 Thread Lie Ryan
On 12/19/2011 12:16 AM, nukeymusic wrote: On 18 dec, 13:39, Lie Ryan wrote: On 12/18/2011 10:00 PM, nukeymusic wrote: How can I load a python-script after starting python in the interactive mode? I tried with load 'myscript.py' myscript.py myscript but none of these wor

Re: what does 'a=b=c=[]' do

2011-12-24 Thread Lie Ryan
On 12/22/2011 10:20 AM, Dennis Lee Bieber wrote: which is to define the names "a", "b", and "c", and connects the three names to the single object (integer 7 or new empty list). note that this "connects" and "disconnecting" business is more commonly referred to in python parlance as "binding"

Re: Early and late binding [was Re: what does 'a=b=c=[]' do]

2011-12-24 Thread Lie Ryan
On 12/24/2011 07:25 PM, Steven D'Aprano wrote: I'd use a function attribute. def func(x, y=None): if y is None: y = func.default_y ... func.default_y = [] That's awkward only if you believe function attributes are awkward. I do. All you've done is move the default from *before* the

Re: Test None for an object that does not implement ==

2011-12-25 Thread Lie Ryan
On 12/25/2011 08:38 PM, Nobody wrote: nothing should compare equal to None except for None itself, so "x is None" > and "x == None" shouldn't produce different results unless there's a > bug in the comparison method. not necessarily, for example: import random class OddClass: def __eq__(s

Re: Test None for an object that does not implement ==

2011-12-25 Thread Lie Ryan
On 12/26/2011 01:13 AM, Roy Smith wrote: In article, Chris Angelico wrote: On Mon, Dec 26, 2011 at 12:17 AM, Roy Smith wrote: Just for fun, I tried playing around with subclassing NoneType and writing an __eq__ for my subclass. Turns out, you can't do that: Traceback (most recent call la

Re: Plot seems weird

2011-12-26 Thread Lie Ryan
On 12/26/2011 05:27 AM, Yigit Turgut wrote: On Dec 25, 7:06 pm, Rick Johnson wrote: On Dec 25, 9:33 am, Yigit Turgut wrote: Hi all, I have a text file as following; 0.2000470.00 0.2000530.16 0.2000590.00 0.2000650.08 0.2000720.

Re: Backslash Escapes

2011-12-26 Thread Lie Ryan
On 12/26/2011 12:04 PM, Felipe O wrote: Hi all, Whenever I take any input (raw_input, of course!) or I read from a file, etc., any backslashes get escaped automatically. Python never escapes backslashes when reading from raw_input or files. Python only ever escapes backslashes when displaying

Re: Plot seems weird

2011-12-26 Thread Lie Ryan
On 12/27/2011 04:08 AM, Yigit Turgut wrote: On Dec 26, 11:28 am, Lie Ryan wrote: On 12/26/2011 05:27 AM, Yigit Turgut wrote: On Dec 25, 7:06 pm, Rick Johnsonwrote: On Dec 25, 9:33 am, Yigit Turgutwrote: Hi all, I have a text file as following; 0.2000470.00

Re: confused about __new__

2011-12-26 Thread Lie Ryan
On 12/27/2011 04:48 PM, Fredrik Tolf wrote: On Mon, 26 Dec 2011, K. Richard Pixley wrote: I don't understand. Can anyone explain? I'm also a bit confused about __new__. I'd very much appreciate it if someone could explain the following aspects of it: * The manual (

Re: Which libraries for Python 2.5.2

2011-12-27 Thread Lie Ryan
On 12/28/2011 03:03 AM, W. eWatson wrote: Here's the traceback. The traceback seems to imply that matplotlib is not being installed properly. Have you tried uninstalling then reinstalling matplotlib? -- http://mail.python.org/mailman/listinfo/python-list

Re: Plot seems weird

2011-12-27 Thread Lie Ryan
On 12/27/2011 06:14 AM, Yigit Turgut wrote: On Dec 26, 8:58 pm, Lie Ryan wrote: On 12/27/2011 04:08 AM, Yigit Turgut wrote: not your fault, I made a mistake when copy-pasteing the code, here's the fixed code: from itertools import izip_longest def to_square(data): sq

Re: python logging module:a quick question

2011-12-27 Thread Lie Ryan
On 12/27/2011 05:26 PM, Littlefield, Tyler wrote: Hello all: I have a basic server I am working on, and wanted some input with an error I'm getting. I am initializing the logger like so: if __name__ == "__main__": observer = log.PythonLoggingObserver() observer.start() logging.basicConfig(filenam

Re: Daemon management

2011-12-27 Thread Lie Ryan
On 12/27/2011 12:43 PM, Fredrik Tolf wrote: Dear list, Lately, I've had a personal itch to scratch, in that I run a couple of Python programs as daemons, and sometimes want to inspect or alter them in ad-hoc ways, or other times need to do things to them that are less ad-hoc in nature, but never

Re: Python education survey

2011-12-27 Thread Lie Ryan
On 12/28/2011 03:37 AM, Rick Johnson wrote: My logic is this: """ Including an IDE in the stdlib may have been a bad idea (although i understand and support Guido's original vision for IDLE). But since we do have it, we need to either MAINTAIN the package or REMOVE it. We cannot just stick our

Re: Python education survey

2011-12-27 Thread Lie Ryan
On 12/27/2011 10:41 PM, Eelco wrote: *Your suggestion of VIM is especially objectionable. Though I am sure it is a great tool to you, the subject here is beginner education. Just because it is a good tool for you, does not make it a good tool for a beginner. Before using VIM, I used to use ged

Re: Python education survey

2011-12-27 Thread Lie Ryan
On 12/28/2011 05:11 AM, Rick Johnson wrote: On Dec 27, 11:50 am, Lie Ryan wrote: In case you haven't realised it, it is pretty much impossible for a large open source project to "die"; even if Guido decided to remove IDLE from the standard library I don't remember stati

Re: Possible bug in string handling (with kludgy work-around)

2011-12-27 Thread Lie Ryan
On 12/28/2011 05:04 AM, Rick Johnson wrote: -- Note: superfluous indention removed for clarity! -- On Dec 27, 8:53 am, Dennis Lee Bieber wrote: You can get by without the backslash in this situation too, by using triple quoting: I would not do that because: 1. Because Python already has TWO

Re: Possible bug in string handling (with kludgy work-around)

2011-12-28 Thread Lie Ryan
On 12/28/2011 11:57 AM, Rick Johnson wrote: On Dec 27, 3:38 pm, Terry Reedy wrote: On 12/27/2011 1:04 PM, Rick Johnson wrote: But this brings up a very important topic. Why do we even need triple quote string literals to span multiple lines? Good question, and one i have never really mused on

Re: reverse() is not working

2011-12-28 Thread Lie Ryan
On 12/29/2011 05:02 AM, Nirmal Kumar wrote: I am trying to pass the id to thanks view through reverse. But it's not working. I'm getting this error Reverse for 'reg.views.thanks' with arguments '(20,)' and keyword arguments '{}' not found. I posted the question with the code in stackoverflow:

Re: Py-dea: Streamline string literals now!

2011-12-28 Thread Lie Ryan
On 12/29/2011 06:36 AM, Rick Johnson wrote: mlstr = ||| this is a multi line sting that is delimited by "triple pipes". Or we could just 'single pipes' if we like, however, i think the "triple pipe' is easier to see. Since the pipe char is so rare in Python source, it becomes the obvious choice.

Re: Py-dea: Streamline string literals now!

2011-12-28 Thread Lie Ryan
On 12/28/2011 04:34 PM, Rick Johnson wrote: On Dec 27, 9:49 pm, Rick Johnson wrote: The fact is...even with the multi-line issue solved, we still have two forms of literal delimiters that encompass two characters resulting in *four* possible legal combinations of the exact same string! I don't

Re: Pythonification of the asterisk-based collection packing/unpacking syntax

2011-12-28 Thread Lie Ryan
On 12/28/2011 11:08 PM, Eelco wrote: I personally feel any performance benefits are but a plus; they are not the motivating factor for this idea. I simply like the added verbosity and explicitness, thats the bottom line. Any performance benefits are a plus, I agree, as long as it doesn't make

Re: Py-dea: Streamline string literals now!

2011-12-29 Thread Lie Ryan
On 12/29/2011 12:44 PM, Dan Sommers wrote: On Wed, 28 Dec 2011 22:54:16 +, Steven D'Aprano wrote: On Wed, 28 Dec 2011 11:36:17 -0800, Rick Johnson wrote: The point is people, we should be using string delimiters that are ANYTHING besides " and '. Stop being a sheep and use your brain! "

Re: Pythonification of the asterisk-based collection packing/unpacking syntax

2011-12-29 Thread Lie Ryan
On 12/30/2011 12:23 AM, Steven D'Aprano wrote: On Thu, 29 Dec 2011 03:55:14 -0800, Eelco wrote: I would argue that the use of single special characters to signal a relatively complex and uncommon construct is exactly what I am trying to avoid with this proposal. This would be the proposal to

Re: How to get function string name from i-th stack position?

2011-12-31 Thread Lie Ryan
On 12/31/2011 08:48 AM, Ian Kelly wrote: But they are two distinct function objects, and there is no way programmatically to determine that they are the same function except by comparing the bytecode (which won't work generally because of the halting problem). Actually, it is often possible to

Re: .format vs. %

2011-12-31 Thread Lie Ryan
On 01/01/2012 05:44 AM, davidfx wrote: Thanks for your response. I know the following code is not going to be correct but I want to show you what I was thinking. formatter = "%r %r %r %r" print formatter % (1, 2, 3, 4) What is the .format version of this concept? I don't think the (%r)epr

Re: Spamming PyPI with stupid packages

2012-01-01 Thread Lie Ryan
On 01/02/2012 09:33 AM, Robert Kern wrote: On 1/1/12 10:18 PM, Matt Chaput wrote: Someone seems to be spamming PyPI by uploading multiple stupid packages. Not sure if it's some form of advertising spam or just idiocy. Don't know if we should care though... maybe policing uploads is worse than c

Re: Spamming PyPI with stupid packages

2012-01-02 Thread Lie Ryan
On 01/02/2012 11:20 PM, Peter Otten wrote: Felinx Lee wrote: I have removed those packages (girlfriend and others) from PyPI forever, I apologize for that. The thought police has won :( I think the community has a right to defend themselves against trolls. If it's just bad naming, we can p

Re: a little help

2012-01-05 Thread Lie Ryan
On 01/05/2012 11:29 AM, Andres Soto wrote: my mistake is because I have no problem to do that using Prolog which use an interpreter as Python. I thought that the variables in the main global memory space (associated with the command line environment) were kept, although the code that use it could

Re: help me get excited about python 3

2012-01-05 Thread Lie Ryan
On 01/05/2012 03:41 PM, Evan Driscoll wrote: On 1/4/2012 9:56 AM, Sean Wolfe wrote: I am still living in the 2.x world because all the things I want to do right now in python are in 2 (django, pygame). But I want to be excited about the future of the language. I understand the concept of needing

Re: a little help

2012-01-05 Thread Lie Ryan
On 01/06/2012 03:04 AM, Andres Soto wrote: Please, see my comments between your lines. Thank you very much for your explanation! * * *From:* Lie Ryan *To:* python-list@python.org *Sent:* Thursday, January 5, 2012 2:30 AM *Subject:* Re: a little help On 01/05

Re: replacing __dict__ with an OrderedDict

2012-01-06 Thread Lie Ryan
On 01/06/2012 08:48 PM, Ulrich Eckhardt wrote: Hi! The topic explains pretty much what I'm trying to do under Python 2.7[1]. The reason for this is that I want dir(SomeType) to show the attributes in the order of their declaration. This in turn should hopefully make unittest execute my tests in

Re: replacing __dict__ with an OrderedDict

2012-01-06 Thread Lie Ryan
On 01/07/2012 12:36 AM, Ulrich Eckhardt wrote: Am 06.01.2012 12:43, schrieb Lie Ryan: On 01/06/2012 08:48 PM, Ulrich Eckhardt wrote: Hi! The topic explains pretty much what I'm trying to do under Python 2.7[1]. The reason for this is that I want dir(SomeType) to show the attributes i

Re: replacing __dict__ with an OrderedDict

2012-01-06 Thread Lie Ryan
On 01/07/2012 04:20 AM, Ian Kelly wrote: On Fri, Jan 6, 2012 at 10:01 AM, Lie Ryan wrote: That unittest executes its tests in alphabetical order is implementation detail for a very good reason, and good unittest practice dictates that execution order should never be defined (some even argued

Re: how to get id(function) for each function in stack?

2012-01-06 Thread Lie Ryan
On 01/07/2012 06:50 AM, Ian Kelly wrote: On Fri, Jan 6, 2012 at 12:29 PM, dmitrey wrote: Python build-in function sum() has no attribute func_code, what should I do in the case? Built-in functions and C extension functions have no code objects, and for that reason they also do not exist in th

Re: replacing __dict__ with an OrderedDict

2012-01-06 Thread Lie Ryan
On 01/07/2012 11:49 AM, Steven D'Aprano wrote: You may not be able to run tests*simultaneously*, due to clashes involving external resources, but you should be able to run them in random order. tests that involves external resources should be mocked, although there are always a few external re

Re: MOST COMMON QUESTIONS ASKED BY NON-MUSLIMS ?????????

2012-01-07 Thread Lie Ryan
On 01/04/2012 05:24 AM, gene heskett wrote: On Tuesday, January 03, 2012 01:13:08 PM John Ladasky did opine: On Jan 3, 7:40 am, BV wrote: MOST COMMON QUESTIONS ASKED BY NON-MUSLIMS Q0. Why do thousand-line religious posts appear in comp.lang.python? Already discussed, at considerable leng

Re: replacing __dict__ with an OrderedDict

2012-01-09 Thread Lie Ryan
On 01/09/2012 09:03 AM, Eelco wrote: i havnt read every post in great detail, but it doesnt seem like your actual question has been answered, so ill give it a try. AFAIK, changing __dict__ to be an ordereddict is fundamentally impossible in python 2. __dict__ is a builtin language construct hard

Re: replacing __dict__ with an OrderedDict

2012-01-10 Thread Lie Ryan
On 01/10/2012 12:05 PM, Roy Smith wrote: Somewhat more seriously, let's say you wanted to do test queries against a database with 100 million records in it. You could rebuild the database from scratch for each test, but doing so might take hours per test. Sometimes, real life is just*so* incon

Re: replacing __dict__ with an OrderedDict

2012-01-10 Thread Lie Ryan
On 01/10/2012 12:16 AM, Ulrich Eckhardt wrote: Am 09.01.2012 13:10, schrieb Lie Ryan: I was just suggesting that what the OP thinks he wants is quite likely not what he actually wants. Rest assured that the OP has a rather good idea of what he wants and why, the latter being something you

Re: replacing __dict__ with an OrderedDict

2012-01-10 Thread Lie Ryan
On 01/10/2012 03:59 AM, Ulrich Eckhardt wrote: There is another dependency and that I'd call a logical dependency. This occurs when e.g. test X tests for an API presence and test Y tests the API behaviour. In other words, Y has no chance to succeed if X already failed. Unfortunately, there is n

Re: python philosophical question - strong vs duck typing

2012-01-10 Thread Lie Ryan
On 01/09/2012 04:35 PM, John Nagle wrote: A type-inferring compiler has to analyze the whole program at once, because the type of a function's arguments is determined by its callers. This is slow. The alternative is to guess what the type of something is likely to be, compile code at run time, an

Re: replacing __dict__ with an OrderedDict

2012-01-10 Thread Lie Ryan
On 01/11/2012 01:05 AM, Roy Smith wrote: In article, Lie Ryan wrote: On 01/10/2012 12:05 PM, Roy Smith wrote: Somewhat more seriously, let's say you wanted to do test queries against a database with 100 million records in it. You could rebuild the database from scratch for each test

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