Oh, thanks. Didn't think of that.
On Tue, Jan 7, 2020, 7:53 PM Michael Torrie wrote:
> On 1/7/20 8:46 PM, Shashank Tiwari wrote:
> > Yes, I tried this and it worked. I was wondering if I could use the
> output
> > of pow (or math.pow).
>
> Sure:
>
> pow
Thanks everyone. Much appreciated.
On Tue, Jan 7, 2020, 7:46 PM Shashank Tiwari
wrote:
> Yes, I tried this and it worked. I was wondering if I could use the output
> of pow (or math.pow).
>
> On Tue, Jan 7, 2020, 7:41 PM Michael Torrie wrote:
>
>> On 1/7/20 8:18 PM,
Yes, I tried this and it worked. I was wondering if I could use the output
of pow (or math.pow).
On Tue, Jan 7, 2020, 7:41 PM Michael Torrie wrote:
> On 1/7/20 8:18 PM, Shashank Tiwari wrote:
> > Thanks Chris. What if it's pow(2.2,0.45)?
>
> Why not do some more experimentation:
Thanks Chris. What if it's pow(2.2,0.45)?
On Tue, Jan 7, 2020, 6:40 PM Chris Angelico wrote:
> On Wed, Jan 8, 2020 at 1:37 PM Shashank Tiwari
> wrote:
> >
> > Thanks Rob.
> >
> > How would one initialize a Decimal with something like pow(2,256)?
> >
>
>
Thanks Rob.
How would one initialize a Decimal with something like pow(2,256)?
On Tue, Jan 7, 2020 at 5:25 PM Rob Gaddi
wrote:
> On 1/7/20 3:47 PM, Shashank Tiwari wrote:
> > In Python3 an operation as follows:
> >>>> 10135.1941 * (10**8)
> > gives
In Python3 an operation as follows:
>>> 10135.1941 * (10**8)
gives the result: 101351941.0001
Similarly, using the pow function also gives the same overflow/underflow
error.
>>> 10135.1941 * pow(10,8)
101351941.0001
Like multiplication, division of large or very small floating point
shashank added the comment:
It won't exactly be drop-in replacement.
I mean if users decide to replace Tarfile with SafeTarFile, existing code may
break since there might be cases where dodgy tarballs are acceptable and/or
used then SafeTarFile.open will throw an exception.
Having said
shashank added the comment:
Added tests.
Patch file: safetarfile-4.diff
Following works with 456 tests passed, after doing `make clean && make`
# ./python -m unittest -v test.test_tarfile
Attached patch is on top of master's commit:
commit 2aaf98c16ae3070378de523a173e29644037d8
shashank added the comment:
I can't use Jakub's repo (or Makefile from that repo) directly because it
relies on tar, which doesn't look like dependency for building Python. I can
make similar tarballs but I am not sure how licensing will work. I can add
tarballs for the cases I discovered
shashank added the comment:
Figured a fix for the bug I found, trick was to keep track of current working
dir of symlink it was trying to evaluate.
Attached patch: safetarfile-3.diff
Patch is for code only.
I'd like to see this go thorough, and would appreciate feedback.
--
Added
shashank added the comment:
1. I have done some changes to Lar's patch to address class of bugs which Jakub
found.
Attached patch safetarfile-2.diff
Patch is for code only and is work in progress.
2. However, there maybe several edge cases which have not been covered. Going
by types
shashank added the comment:
A. Regrading Jakub's tests, I suppose the changes needed are to
for every name in tar
i) find reasonable occurrence of symlink's name and replace it with smylink's
linkname
ii) convert it to normal path and then check for relative / absolute paths
B. Jakub
Shashank Agarwal added the comment:
I would like to work on this..
--
nosy: +The_Knight
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
of which apparently
Forgot the refs:
[1]https://github.com/facebook/fbconsole;
http://blog.carduner.net/2011/09/06/easy-facebook-scripting-in-python/
[2]https://github.com/jgorset/facepy
--
http://mail.python.org/mailman/listinfo/python-list
--
Regards
Shashank Singh
http
value pairs
--
Regards
Shashank Singh
http://www.flipora.com
http://r http://www.cse.iitb.ac.in/~shashanksinghationalpie.wordpress.com
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Apr 10, 2012 at 12:16 AM, Dave Angel d...@davea.name wrote:
On 04/10/2012 02:04 AM, Shashank Singh wrote:
On Mon, Apr 9, 2012 at 10:49 PM, Nikhil Verma varma.nikhi...@gmail.com
wrote:
SNIP
I am trying this but its giving me a generator object.
In [9]: (k for k,v
to [] by checking
for None inside the function
def f(a=None):
if a is None: a = []
--
Regards
Shashank Singh
http://rationalpie.wordpress.com
--
http://mail.python.org/mailman/listinfo/python-list
in a list ?
--
http://mail.python.org/mailman/listinfo/python-list
--
Regards
Shashank Singh
http://www.cse.iitb.ac.in/~shashanksingh
--
http://mail.python.org/mailman/listinfo/python-list
', 'le', ' p', 'yt', 'ho', 'n
', 'pr', 'og', 'ra', 'mm', 'in', 'g']
In this case you are actually using the return values (and not
changing a global variable).
HTH
--
Regards
Shashank Singh
http://www.cse.iitb.ac.in/~shashanksingh
--
http://mail.python.org/mailman/listinfo/python-list
sure that the
parameters are such that such cases don't arise but I would still like to see
python doing the best possible thing as far as possible.
--
Regards
Shashank Singh
shashank.sunny.si...@gmail.com
http://www.cse.iitb.ac.in/~shashanksinghhttp://www.cse.iitb.ac.in/%7Eshashanksingh
New submission from Shashank shashank.sunny.si...@gmail.com:
-- Converting the discussion here
http://mail.python.org/pipermail/python-list/2010-November/1259601.html to a
bug report (+nosy for everyone that responded, quoting the initial message for
context)
Are there any promises made
Shashank shashank.sunny.si...@gmail.com added the comment:
@Raymond: I don't have a particular use case where I had a problem with this
behavior. I came across this problem when looking at this issue
http://bugs.python.org/issue6305.
An important problem that can happen with this behavior
://docs.python.org/library/itertools.html#itertools.islice
--
Regards
Shashank Singh
shashank.sunny.si...@gmail.com
http://www.cse.iitb.ac.in/~shashanksinghhttp://www.cse.iitb.ac.in/%7Eshashanksingh
--
http://mail.python.org/mailman/listinfo/python-list
Shashank shashank.sunny.si...@gmail.com added the comment:
I had uploaded an incorrect patch. New corrected patch against trunk (on Mac OS
uploaded).
--
Added file: http://bugs.python.org/file19494/zipdecrypt.patch
___
Python tracker rep
Changes by Shashank shashank.sunny.si...@gmail.com:
Removed file: http://bugs.python.org/file19494/zipdecrypt.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10030
Changes by Shashank shashank.sunny.si...@gmail.com:
Added file: http://bugs.python.org/file19495/zipdecrypt.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10030
Shashank shashank.sunny.si...@gmail.com added the comment:
the C module should be private and therefore called _zipdecrypt
done
if you want to avoid API mismatch, you could give a tp_call to your C
decrypter object, rather than a decrypt method
done
- you can put all initialization code
Shashank shashank.sunny.si...@gmail.com added the comment:
Attached is a patch with changes in Lib/test/test_zipfile.py to test both C and
pure-py impls (on systems where the C impl is present).
Admittedly, this approach to emulating the absence of C impl is a bit hacky.
This is primarily
Changes by Shashank shashank.sunny.si...@gmail.com:
Added file: http://bugs.python.org/file19197/zipdecrypt.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10030
Shashank shashank.sunny.si...@gmail.com added the comment:
I have updated the patch with a check for the availability of C impl and to use
pure-py impl as a fallback.
How do you suggest would the tests change? As I had mentioned before, in my
understanding since there is no change in the API
New submission from Shashank shashank.sunny.si...@gmail.com:
As promised in this thread
http://mail.python.org/pipermail/python-dev/2009-August/091450.html (a year
ago!), attached is a patch that replaces simple zip decryption logic written in
pure python with that in C.
As reported
a concise name.
Thanks,
Tobiah
--
http://mail.python.org/mailman/listinfo/python-list
--
Regards
Shashank Singh
shashank.sunny.si...@gmail.com
http://www.cse.iitb.ac.in/~shashanksinghhttp://www.cse.iitb.ac.in/%7Eshashanksingh
--
http://mail.python.org/mailman/listinfo/python-list
-list
--
Regards
Shashank Singh
Senior Undergraduate, Department of Computer Science and Engineering
Indian Institute of Technology Bombay
shashank.sunny.si...@gmail.com
http://www.cse.iitb.ac.in/~shashanksingh
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Jul 30, 2010 at 10:53 PM, joy99 subhakolkata1...@gmail.com wrote:
class Person(object):
def _init_(self,name,age):
self.name=name
self.age=age
constructor has double underscores (both as prefix and suffix) __init__
--
Regards
Shashank Singh
suggestions will be appreciated.
TIA
--
Regards
Shashank Singh
Senior Undergraduate, Department of Computer Science and Engineering
Indian Institute of Technology Bombay
shashank.sunny.si...@gmail.com
http://www.cse.iitb.ac.in/~shashanksingh
--
http://mail.python.org/mailman/listinfo/python-list
/imap. Another problem with
map/imap is that the memory cost is dependent on the length of the list
(because of the intermediate mapped list stored) which is not the case for
simple for loop.
I hope I have explained it better this time.
--
Regards
Shashank Singh
Senior Undergraduate, Department
the value of nodes will not automatically
do that.
HTH
-S
Thanks
~S
--
http://mail.python.org/mailman/listinfo/python-list
--
Regards
Shashank Singh
Senior Undergraduate, Department of Computer Science and Engineering
Indian Institute of Technology Bombay
shashank.sunny.si...@gmail.com
--
Regards
Shashank Singh
Senior Undergraduate, Department of Computer Science and Engineering
Indian Institute of Technology Bombay
shashank.sunny.si...@gmail.com
http://www.cse.iitb.ac.in/~shashanksingh
--
http://mail.python.org/mailman/listinfo/python-list
of solutions people might have.
Thanks,
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
--
Regards
Shashank Singh
Senior Undergraduate, Department of Computer Science and Engineering
Indian Institute of Technology Bombay
shashank.sunny.si...@gmail.com
http://www.cse.iitb.ac.in
then it should write that as doubtful and rest it should write as error.
Thanks,
--
http://mail.python.org/mailman/listinfo/python-list
--
Regards
Shashank Singh
Senior Undergraduate, Department of Computer Science and Engineering
Indian Institute of Technology Bombay
shashank.sunny.si
how to solve my downloading
problem or how to get Brown Corpus from some other link.
Thanks in advance.
--
http://mail.python.org/mailman/listinfo/python-list
--
Regards
Shashank Singh
Senior Undergraduate, Department of Computer Science and Engineering
Indian Institute of Technology Bombay
and is modified with each
call.
hth
--shashank
On Thu, Mar 11, 2010 at 3:02 PM, jitendra gupta jitu.ic...@gmail.comwrote:
def foo(x = [0]):
x[0] = x[0] + 1
return x[0]
def soo(x = None):
if x is None:
x = [0]
x[0] = x[0] + 1
return x[0]
foo()
1
foo() #See the behavior incremented by one
2
, level = 0):
MAXLEVEL = 7
if level MAXLEVEL:
return #possibly the data has a cycle/loop
for (nm, dt) in levelDict:
Are you sure your key values are 2-tuples in levelDict?
For-each on dicts enumerates the keys AFAIK
--
Regards
Shashank Singh
Senior Undergraduate, Department of Computer
of a piece of text? I mean, as long as we are not trying
to get a symbolic representation of a text or get ith character
of it, all we need to do is to carry the intended encoding as
an auxiliary information to the data stored as byte array.
Right?
--shashank
--
http://mail.python.org/mailman
Shashank shashank.sunny.si...@gmail.com added the comment:
Works fine for me in 2.6 but fails as said by OP on 2.5.
(I came across this in the course of my work and am submitting a change
in a bug for the first time, pardon me if something is inappropriate :)
I used this modified codeblock
45 matches
Mail list logo