I've a huge csv file and I want to read stuff from it again and again. Is it
useful to pickle it and keep and then unpickle it whenever I need to use that
data? Is it faster that accessing that file simply by opening it again and
again? Please explain, why?
Thank you.
--
Keep it in memory
On 16 oct. 2013, at 08:55 AM, Harsh Jha harshjha2...@gmail.com wrote:
I've a huge csv file and I want to read stuff from it again and again. Is it
useful to pickle it and keep and then unpickle it whenever I need to use that
data? Is it faster that accessing that file
On 16/10/2013 07:55, Harsh Jha wrote:
I've a huge csv file and I want to read stuff from it again and again. Is it
useful to pickle it and keep and then unpickle it whenever I need to use that
data? Is it faster that accessing that file simply by opening it again and
again? Please explain,
On Wednesday, October 16, 2013 12:35:42 PM UTC+5:30, Stéphane Wirtel wrote:
Keep it in memory
Thats a strange answer given that the OP says his file is huge.
Of course 'huge' may not really be huge -- that really depends on the h/w he's
using.
--
On Wed, Oct 16, 2013 at 7:51 PM, rusi rustompm...@gmail.com wrote:
On Wednesday, October 16, 2013 12:35:42 PM UTC+5:30, Stéphane Wirtel wrote:
Keep it in memory
Thats a strange answer given that the OP says his file is huge.
Of course 'huge' may not really be huge -- that really depends on
Hi all.
I'm having troubles with urllib2 timeout.
See the following script :
import urllib2
result = urllib2.urlopen(http://dumdgdfgdgmyurl.com/;)
print result.readline()
If run on my Debian Wheezy computer, or on my Debian Squeeze
Le 16/10/2013 11:21, Jérôme a écrit :
Hi all.
I'm having troubles with urllib2 timeout.
See the following script :
import urllib2
result = urllib2.urlopen(http://dumdgdfgdgmyurl.com/;)
print result.readline()
If run on my Debian
Jérôme wrote:
Hi all.
I'm having troubles with urllib2 timeout.
See the following script :
import urllib2
result = urllib2.urlopen(http://dumdgdfgdgmyurl.com/;)
print result.readline()
If run on my Debian Wheezy computer,
Erminio Ottone e...@ottone.it wrote in message
news:20131013114826.1419.6522.XPN@sator...
Would you like to become a developer of this program ?
http://pycam.sourceforge.net/
machines stl models?
The problem with stl is its just triangles. Video game stuff.
Iv'e machined stl models, only
Jérôme jer...@jolimont.fr writes:
Hi all.
I'm having troubles with urllib2 timeout.
See the following script :
import urllib2
result = urllib2.urlopen(http://dumdgdfgdgmyurl.com/;)
print result.readline()
If run on my Debian
In article l3l850$2aq$1...@dont-email.me, John Nagle na...@animats.com
wrote:
Then upgrade to 3D. You can represent latitude and longitude
as a 3-element unit vector. (GPS systems do this; latitude and
longitude are only generated at the end, for output.)
And annoyingly so. Somebody I
In article 0044bfd0-f07f-4f7b-b976-5df034b6f...@googlegroups.com,
Harsh Jha harshjha2...@gmail.com wrote:
I've a huge csv file and I want to read stuff from it again and again. Is it
useful to pickle it and keep and then unpickle it whenever I need to use that
data? Is it faster that
On 2013-10-16 13:22, Peter Otten wrote:
The problem might be ipv6-related.
I second this as the likely culprit -- I've had to disable IPv6 on my
Debian laptop since my ATT router is brain-dead and doesn't seem to
support it, so I would often get timeouts similar to what is the OP
describes and
If run on my Debian Wheezy computer, or on my Debian Squeeze server,
the answer is instantaneous :
[...]
urllib2.URLError: urlopen error [Errno -2] Name or service not known
When run on my Raspberry Pi with Raspian Wheezy, the answer is
identical but it takes 10 seconds.
What happens when
On Tue, Oct 15, 2013 at 2:46 PM, Grant Edwards invalid@invalid.invalid wrote:
On 2013-10-15, Mark Janssen dreamingforw...@gmail.com wrote:
Yeah, well 40 years ago they didn't have parsers.
That seems an odd thing to say. People were assembling and compiling
computer programs long before
Types on the other hand correspond to our classifications and so are
things in our minds.
That is not how a C programmer views it. They have explicit
typedefs that make it a thing for the computer.
Speaking as a C programmer, no. We have explicit typedefs to create new
labels for
On Wednesday, October 16, 2013 11:27:03 PM UTC+5:30, zipher wrote:
Types on the other hand correspond to our classifications and so are
things in our minds.
That is not how a C programmer views it. They have explicit
typedefs that make it a thing for the computer.
Speaking as a C
On 2013-10-16, Mark Janssen dreamingforw...@gmail.com wrote:
On Tue, Oct 15, 2013 at 2:46 PM, Grant Edwards invalid@invalid.invalid
wrote:
On 2013-10-15, Mark Janssen dreamingforw...@gmail.com wrote:
Yeah, well 40 years ago they didn't have parsers.
That seems an odd thing to say. People
On 2013-10-16, Mark Janssen dreamingforw...@gmail.com wrote:
Types on the other hand correspond to our classifications and so are
things in our minds.
That is not how a C programmer views it. They have explicit
typedefs that make it a thing for the computer.
Speaking as a C programmer, no.
Who uses object abstraction in C? No one. That's why C++ was invented.
I wonder if you've heard of something called linux?
http://lwn.net/Articles/444910/
If not, Linux, how about Python?
http://hg.python.org/cpython/file/e2a411a429d6/Objects
Skip
--
On 10/13/2013 10:02 PM, Steven D'Aprano wrote:
On Sun, 13 Oct 2013 20:13:32 -0700, Tim Roberts wrote:
def add(c1, c2):
% Decode
c1 = ord(c1) - 65
c2 = ord(c2) - 65
% Process
i1 = (c1 + c2) % 26
% Encode
return chr(i1+65)
Python uses # for comments,
Charles Hixson charleshi...@earthlink.net writes:
On 10/13/2013 10:02 PM, Steven D'Aprano wrote:
On Sun, 13 Oct 2013 20:13:32 -0700, Tim Roberts wrote:
def add(c1, c2):
% Decode
c1 = ord(c1) - 65
c2 = ord(c2) - 65
% Process
i1 = (c1 + c2) % 26
%
On Thu, Oct 17, 2013 at 5:49 AM, Skip Montanaro s...@pobox.com wrote:
Who uses object abstraction in C? No one. That's why C++ was invented.
I wonder if you've heard of something called linux?
http://lwn.net/Articles/444910/
If not, Linux, how about Python?
On Tuesday, October 15, 2013 11:55:26 PM UTC-7, Harsh Jha wrote:
I've a huge csv file and I want to read stuff from it again and again. Is it
useful to pickle it and keep and then unpickle it whenever I need to use that
data? Is it faster that accessing that file simply by opening it again
On 16-10-2013 23:04, Peter Cacioppi wrote:
On Tuesday, October 15, 2013 11:55:26 PM UTC-7, Harsh Jha wrote:
I've a huge csv file and I want to read stuff from it again and again. Is it
useful
to pickle it and keep and then unpickle it whenever I need to use that data?
Is it
faster that
I've been looking at TkInter and GTK to do some GUI programming, they're both
cross-platform compatible.
This might seem like a stupid question, but, how do people run the application?
I get that I have to compile it and make it an executable. But how do I make it
an executable? For Windows
I have the following code to make a plot of 4 different supply curves
(economics).
from matplotlib import pyplot as plt
price = range(0,51)
q1 = [x/2.0 for x in price]
q2 = [x/4.0 for x in price]
q3 = [x/5.0 for x in price]
q4 = [x/10.0 for x in price]
markers_on = [20, 40]
On 16/10/2013 22:34, Brandon La Porte wrote:
I have the following code to make a plot of 4 different supply curves
(economics).
from matplotlib import pyplot as plt
price = range(0,51)
q1 = [x/2.0 for x in price]
q2 = [x/4.0 for x in price]
q3 = [x/5.0 for x in price]
q4 = [x/10.0 for x in
On 14/10/2013 06:02, Steven D'Aprano wrote:
On Sun, 13 Oct 2013 20:13:32 -0700, Tim Roberts wrote:
def add(c1, c2):
% Decode
c1 = ord(c1) - 65
c2 = ord(c2) - 65
% Process
i1 = (c1 + c2) % 26
% Encode
return chr(i1+65)
Python uses # for comments, not
On 16/10/2013 23:39, Rotwang wrote:
On 14/10/2013 06:02, Steven D'Aprano wrote:
On Sun, 13 Oct 2013 20:13:32 -0700, Tim Roberts wrote:
def add(c1, c2):
% Decode
c1 = ord(c1) - 65
c2 = ord(c2) - 65
% Process
i1 = (c1 + c2) % 26
% Encode
return
Andreas Ecaz ecazs@gmail.com writes:
This might seem like a stupid question, but, how do people run the
application? I get that I have to compile it and make it an
executable. But how do I make it an executable? For Windows and Linux?
This isn't a question about GUIs, but about making a
Hello
Can somebody tell me how I can test BockHosts? I want to see if an IP address
gets blocked or not, as I have to provide evidence of testing for a
presentation.
Any help will be greatly appreciated, thank you
--
https://mail.python.org/mailman/listinfo/python-list
Dear all,
I have the following code in projects.py:
##33
for row in xrange(len(uniqueFields)):
instance = QtGui.QCheckBox(uniqueFields[row])
projectsFindInstance.projectsInstance.addOnFieldsInstance.update({%s %
version 0.01 created on 17 october 2013 by Skybuck Flying.
(after having some experience with python which lacks repeat
until/goto/labels and programming game bots)
(the exit conditions described below prevent having to use logic inversion:
while BeginCondition and not EndCondition - ugly logic
One final example plus further analysis to be perfectly clear what fine code
would look like and why it's adventage:
At the bottom I come to the conclusion that the proposed loop construct with
begin and ending conditions has merit after all ! ;) =D
LoopBegin
if not BeginningCondition
Mohsen Pahlevanzadeh moh...@pahlevanzadeh.org writes:
and another file,(projectsFind.py) i have the following code:
#3
for key, val in
self.projectsInstance.addOnFieldsInstance.items():
instance =
Skybuck Flying windows7i...@dreampc2006.com writes:
version 0.01 created on 17 october 2013 by Skybuck Flying.
Thanks for writing your essay, but it's rather too long and context-free
to make a good post here.
Could you please post it on your weblog instead?
--
\ “Beware of and eschew
On Thu, 2013-10-17 at 10:45 +1100, Ben Finney wrote:
Mohsen Pahlevanzadeh moh...@pahlevanzadeh.org writes:
and another file,(projectsFind.py) i have the following code:
#3
for key, val in
Who uses object abstraction in C? No one. That's why C++ was invented.
If not, Linux, how about Python?
http://hg.python.org/cpython/file/e2a411a429d6/Objects
Or huge slabs of the OS/2 Presentation Manager, which is entirely
object oriented and mostly C. It's done with SOM, so it's
Mohsen Pahlevanzadeh moh...@pahlevanzadeh.org writes:
Thank you for your useful link , i paste my code into [an external
pastebin service]
I'm glad you liked the link, but you haven't followed its advice :-)
Also, pointing us to a pastebin is not helpful. Please use a user-agent
that won't
On Oct 16, 2013 11:54 PM, MRAB pyt...@mrabarnett.plus.com wrote:
On 16/10/2013 23:39, Rotwang wrote:
On 14/10/2013 06:02, Steven D'Aprano wrote:
On Sun, 13 Oct 2013 20:13:32 -0700, Tim Roberts wrote:
def add(c1, c2):
% Decode
c1 = ord(c1) - 65
c2 = ord(c2) - 65
On Thu, Oct 17, 2013 at 11:13 AM, Mark Janssen
dreamingforw...@gmail.com wrote:
But, here it is significant that the user /consumer (i.e. *at the
workstation* mind you) is *making* the object because thier visual
system turns it into one. Otherwise, at the C-level, I'm guessing
it's normal C
On 17/10/2013 3:57 AM, Mark Janssen wrote:
Who uses object abstraction in C? No one. That's why C++ was invented.
Aristotle maintained that women have fewer teeth than men; although he
was twice married, it never occurred to him to verify this statement by
examining his wives' mouths. --
You say right, but i don't any time to read all of content of
http://sscce.org/ , But when i saw its description , i found out , it's
a set of law for good answer/question, Also i saw PEP 8 , it's like old
style C, and i like CamelCase.
But now, all of my code doesn't work and related to the given
On 16/10/2013 23:14, Mohsen Pahlevanzadeh wrote:
Dear all,
I have the following code in projects.py:
##33
for row in xrange(len(uniqueFields)):
instance = QtGui.QCheckBox(uniqueFields[row])
On Thu, Oct 17, 2013 at 11:43 AM, MRAB pyt...@mrabarnett.plus.com wrote:
I'm guessing, but perhaps you need:
instance = getattr(self, %s % key)
How's that different from getattr(self,str(key))?
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
On 10/16/13 8:13 PM, Mark Janssen wrote:
Who uses object abstraction in C? No one. That's why C++ was invented.
If not, Linux, how about Python?
http://hg.python.org/cpython/file/e2a411a429d6/Objects
Or huge slabs of the OS/2 Presentation Manager, which is entirely
object oriented and
Mohsen Pahlevanzadeh moh...@pahlevanzadeh.org writes:
You say right, but i don't any time to read all of content of
http://sscce.org/ , But when i saw its description , i found out ,
it's a set of law for good answer/question
That's right. Please take the time to help us to help you, by
And your earlier idea that punched cards didn't have tokens is wildly
ignorant of the state of software and languages 50 years ago.
Please tell me how you parsed tokens with binary switches 50 years
ago. Your input is rubbish.
--
MarkJ
Tacoma, Washington
--
On Thu, Oct 17, 2013 at 11:53 AM, Mark Janssen
dreamingforw...@gmail.com wrote:
And your earlier idea that punched cards didn't have tokens is wildly
ignorant of the state of software and languages 50 years ago.
Please tell me how you parsed tokens with binary switches 50 years
ago. Your
This code works fine when there are xls in which Row has One column, but
not when Row has more column.
The expectation is to merge the different xls into a common one.
Can somebody please help.
import xlwt
import xlrd
import sys
#Create workbook and worksheet
wbk = xlwt.Workbook()
dest_sheet =
On Thu, 2013-10-17 at 11:46 +1100, Chris Angelico wrote:
On Thu, Oct 17, 2013 at 11:43 AM, MRAB pyt...@mrabarnett.plus.com wrote:
I'm guessing, but perhaps you need:
instance = getattr(self, %s % key)
How's that different from getattr(self,str(key))?
ChrisA
I get the string of
On Thursday, October 17, 2013 6:17:57 AM UTC+5:30, Ned Batchelder wrote:
On 10/16/13 8:13 PM, Mark Janssen wrote:
Who uses object abstraction in C? No one. That's why C++ was
invented.
Examples from
1. Linux Kernel
2. Python
3. OS/2
But, here it is significant that the user
On Wednesday, 16 October 2013 18:31:09 UTC-4, Mark Lawrence wrote:
On 16/10/2013 22:34, Brandon La Porte wrote:
I have the following code to make a plot of 4 different supply curves
(economics).
from matplotlib import pyplot as plt
price = range(0,51)
q1 = [x/2.0
On 10/16/13 8:53 PM, Mark Janssen wrote:
And your earlier idea that punched cards didn't have tokens is wildly
ignorant of the state of software and languages 50 years ago.
Please tell me how you parsed tokens with binary switches 50 years
ago. Your input is rubbish.
The mention of punched
Mark Janssen dreamingforw...@gmail.com writes:
And your earlier idea that punched cards didn't have tokens is wildly
ignorant of the state of software and languages 50 years ago.
Please tell me how you parsed tokens with binary switches 50 years
ago. Your input is rubbish.
With all due
Last week, Elad Maidar wrote a fairly short but readable opinion
piece[0] illustrating some long-standing social problems in the Ruby
community, ending with a very specific call to action around naming
conventions for Ruby projects and gems. To save you the trouble of
scrolling to the bottom
On Wed, Oct 16, 2013, at 23:13, Owen Jacobson wrote:
* therapist - yeah, It passes as a double meaning - but still.
Or a single meaning. Who's to say the person who wrote the module even
had any idea it could be read otherwise?
* shag
Something to do with carpet?
* db_nazi
See below.
On Wed, Oct 16, 2013 at 8:13 PM, Owen Jacobson
owen.jacob...@grimoire.ca wrote:
-snip-
1. What social biases and problems *do* we unwittingly encourage by way of
community-tolerated behaviour? Where, if not through the conventions for
naming, do we encourage sexism, racism, and other mindlessly
Owen Jacobson owen.jacob...@grimoire.ca writes:
1. What social biases and problems *do* we unwittingly encourage by
way of community-tolerated behaviour?
This is a well-worded good question, and I'd like to draw a connection
with another one you ask:
3. How can we reach out to the Ruby
On Wed, 16 Oct 2013 17:53:22 -0700, Mark Janssen wrote:
And your earlier idea that punched cards didn't have tokens is wildly
ignorant of the state of software and languages 50 years ago.
Please tell me how you parsed tokens with binary switches 50 years ago.
Your input is rubbish.
Mark,
On Thu, 17 Oct 2013 00:22:47 -0400, random832 wrote:
While this flippant usage of Nazi (based on, as I understand it,
Seinfeld's soup nazi) may be offensive, it has nothing to do with
sexism. If the scope of this discussion is to be offensive module names
generally, then the subject line
Raymond Hettinger added the comment:
After more thought, I think that suppress() isn't as clear as ignore() and it
doesn't read as well in typical use cases. I'm assigning this one back to Nick
to decide.
If you want to scan existing code for examples to see how well this would read,
run
Vajrasky Kok added the comment:
Serhiy's commit http://hg.python.org/cpython/rev/2e8c424dc638 fixed this issue
already. So I closed this ticket.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
STINNER Victor added the comment:
On python-dev, abort_on() and trap() were proposed.
--
nosy: +haypo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19266
___
New submission from Serhiy Storchaka:
sched.cancel() breaks events order if events are scheduled on same time and
have same priority.
Patch contains tests which expose this issue.
--
components: Library (Lib)
files: sched_test_stable.patch
keywords: patch
messages: 200040
nosy:
Changes by Serhiy Storchaka storch...@gmail.com:
--
dependencies: +sched.cancel() breaks events order
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13451
___
New submission from Mark Lawrence:
Both Python 2 and 3 docs refer to Raymond Hettinger's original recipe here
http://code.activestate.com/recipes/576693/. Would it be better to link to
pypi https://pypi.python.org/pypi/ordereddict?
--
assignee: docs@python
components: Documentation
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
assignee: docs@python - rhettinger
nosy: +rhettinger
priority: normal - low
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19271
Changes by Aaron Iles aaron.i...@gmail.com:
--
nosy: +aliles
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16500
___
___
Python-bugs-list mailing
Claudiu.Popa added the comment:
Serhiy, are there any left issues with my latest patch? It would be nice if we
could get this into 3.4.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17087
Serhiy Storchaka added the comment:
All patches have problem with stable order. Rehashifying change it. But there
are even more serious problems with current code (see issue19270).
--
___
Python tracker rep...@bugs.python.org
Raymond Hettinger added the comment:
I oppose abort_on() because it implies that it aborts the program.
The word trap() is accurate but will be weird-sounding and non-communicative to
users without a CS background:
with trap(sqlite3.OperationalError):
cursor.execute('CREATE TABLE
Changes by Serhiy Storchaka storch...@gmail.com:
--
assignee: - serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18468
___
___
Roundup Robot added the comment:
New changeset add40e9f7cbe by Serhiy Storchaka in branch 'default':
Issue #18468: The re.split, re.findall, and re.sub functions and the group()
http://hg.python.org/cpython/rev/add40e9f7cbe
--
nosy: +python-dev
___
Vajrasky Kok added the comment:
Serhiy, you forgot to add shorten to __all__.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18725
___
___
Serhiy Storchaka added the comment:
Thank you Antoine for your review.
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18468
Serhiy Storchaka added the comment:
Actually there are two bugs:
1. sched.cancel() can remove wrong event (because it uses equality instead
identity).
2. sched.cancel() change order of equal (by time and priority) events.
--
___
Python tracker
Roundup Robot added the comment:
New changeset 0bd257cd3e88 by Serhiy Storchaka in branch 'default':
Add shorten to __all_ (issues #18585 and #18725).
http://hg.python.org/cpython/rev/0bd257cd3e88
--
___
Python tracker rep...@bugs.python.org
Serhiy Storchaka added the comment:
Thank you Vajrasky. It's Antoine forgot. ;)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18725
___
___
Roundup Robot added the comment:
New changeset 0bd257cd3e88 by Serhiy Storchaka in branch 'default':
Add shorten to __all_ (issues #18585 and #18725).
http://hg.python.org/cpython/rev/0bd257cd3e88
--
___
Python tracker rep...@bugs.python.org
Stefan Krah added the comment:
trap() is a bit ambiguous, since in floating point operations it
means that something is actually raised and not suppressed. So one
could write:
from decimal import *
c = getcontext()
c.traps[Inexact] = True
Decimal(9) / 11 # raises now!
with trap(Inexact):
Claudiu.Popa added the comment:
Added the new patch, which addresses Serhiy's comments.
Also, this approach fails when bytes are involved:
import re
re.search(ba, ba)
Assertion failed: (PyUnicode_Check(op)), function _PyUnicode_CheckConsistency,
file Objects/unicodeobject.c, line 309.
Zero Piraeus added the comment:
'Ignore' and 'suppress' are not synonyms:
https://www.google.com/search?q=define%3Asuppress
forcibly put an end to.
the rising was savagely suppressed
synonyms: subdue, repress, crush, quell, quash, squash, stamp out
Serhiy Storchaka added the comment:
Use correct first argument to getslice().
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17087
___
___
Stefan Krah added the comment:
Zero Piraeus rep...@bugs.python.org wrote:
'Ignore' and 'suppress' are not synonyms:
I wrote synonyms here, meaning that in *this context* they are practically
synonyms. suppress describes the mechanics more precisely, ignore
descibes the human intent:
Sergio Callegari added the comment:
Getting bitten by this with numpy/scipy installations
Having previous scipy installed,
pip install -I scipy
creates a broken scipy installation, because the previous one is not removed
and gets overwritten. For instance, an old spectral.so file leftover
Kim Gräsman added the comment:
Gentle ping.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18314
___
___
Python-bugs-list mailing list
Claudiu.Popa added the comment:
Latest patch attached.
--
Added file: http://bugs.python.org/file32144/sre_repr5.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17087
___
Roundup Robot added the comment:
New changeset 72a5ac909c7a by Richard Oudkerk in branch 'default':
Issue #18999: Make multiprocessing use context objects.
http://hg.python.org/cpython/rev/72a5ac909c7a
--
nosy: +python-dev
___
Python tracker
Changes by Richard Oudkerk shibt...@gmail.com:
--
resolution: - fixed
stage: - committed/rejected
status: open - pending
title: Robustness issues in multiprocessing.{get,set}_start_method - Support
different contexts in multiprocessing
type: behavior - enhancement
Lars Buitinck added the comment:
Thanks, much better than my solution!
--
status: pending - open
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18999
___
Changes by Alan Cristhian alan.cri...@gmail.com:
--
nosy: +Alan.Cristhian
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5342
___
___
New submission from Facundo Batista:
This is ok:
Python 3.4.0a3+ (default:86af5991c809, Oct 13 2013, 16:42:52)
...
import pickle
def f():
... pass
...
pickle.dumps(f)
b'\x80\x03c__main__\nf\nq\x00.'
However, when trying to pickle a lambda, it fails:
pickle.dumps(lambda:
Amaury Forgeot d'Arc added the comment:
Functions are pickled by name, not by code.
Unpickling will only work if a function with the same name is present in in the
same module (__main__ in your example)
This is why pickling a lambda won't work: they have no individual names.
--
nosy:
Changes by Richard Oudkerk shibt...@gmail.com:
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18999
___
___
Changes by Jesús Cea Avión j...@jcea.es:
--
nosy: +jcea
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19272
___
___
Python-bugs-list mailing list
Jesús Cea Avión added the comment:
Would be interesting to be able to pickle function.__code__.
Although, thinking about this, it would be not portable between Python
releases, something that pickle guarantee.
Thoughs?
--
___
Python tracker
Serhiy Storchaka added the comment:
It is too complicated (and perhaps erroneous). Why not use just
self-pattern-logical_charsize?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17087
___
Ethan Furman added the comment:
According to the docs[1]:
12.1.4. What can be pickled and unpickled?
The following types can be pickled:
- None, True, and False
- integers, floating point numbers, complex numbers
- strings, bytes, bytearrays
- tuples, lists, sets, and
1 - 100 of 153 matches
Mail list logo