[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-03-03 Thread Brennan D Baraban


Brennan D Baraban <3...@holbertonschool.com> added the comment:

Hi Stefan. Is there an update you would like me to make on this PR? Otherwise, 
pinging for review.

--

___
Python tracker 
<https://bugs.python.org/issue23460>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35899] '_is_sunder' function in 'enum' module fails on empty string

2019-02-15 Thread Brennan D Baraban


Change by Brennan D Baraban <3...@holbertonschool.com>:


--
keywords: +patch
pull_requests: +11919
stage: needs patch -> patch review

___
Python tracker 
<https://bugs.python.org/issue35899>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35899] '_is_sunder' function in 'enum' module fails on empty string

2019-02-15 Thread Brennan D Baraban


Brennan D Baraban <3...@holbertonschool.com> added the comment:

Yes, I will submit a new PR today.

--

___
Python tracker 
<https://bugs.python.org/issue35899>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-02-13 Thread Brennan D Baraban


Brennan D Baraban <3...@holbertonschool.com> added the comment:

I submitted a PR just now. I only pushed the change to `string.rst`, as per 
Stefan Krah's suggestion.

--

___
Python tracker 
<https://bugs.python.org/issue23460>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-02-13 Thread Brennan D Baraban


Change by Brennan D Baraban <3...@holbertonschool.com>:


--
pull_requests: +11881
stage: needs patch -> patch review

___
Python tracker 
<https://bugs.python.org/issue23460>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35899] '_is_sunder' function in 'enum' module fails on empty string

2019-02-13 Thread Brennan D Baraban

Brennan D Baraban <3...@holbertonschool.com> added the comment:

Thank you, Stéphane. I submitted a change request to your PR just now.

--

___
Python tracker 
<https://bugs.python.org/issue35899>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35973] `growable_int_array type_ignores` in parsetok.c is not always freed.

2019-02-12 Thread Brennan Vincent


Brennan Vincent  added the comment:

Hi Guido,

I have tried applying your patch. It seems to fix the issue (Valgrind no longer 
reports memory definitely lost).

--

___
Python tracker 
<https://bugs.python.org/issue35973>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35973] `growable_int_array type_ignores` in parsetok.c is not always freed.

2019-02-11 Thread Brennan Vincent


New submission from Brennan Vincent :

To reproduce:

(1) build python: `../configure --prefix=$HOME/prefix --with-pydebug 
--without-pymalloc && make install`

(2) run with valgrind: `valgrind --leak-check=full ~/prefix/bin/python3`

(3) exit immediately from the interpreter by pressing ^D

(4) Note the following output from Valgrind:

```
==3810071== 40 bytes in 1 blocks are definitely lost in loss record 3 of 527
==3810071==at 0x4C28B5F: malloc (vg_replace_malloc.c:299)
==3810071==by 0x59ED58: growable_int_array_init (parsetok.c:27)
==3810071==by 0x59EE14: parsetok (parsetok.c:235)
==3810071==by 0x59F697: PyParser_ParseFileObject (parsetok.c:176)
==3810071==by 0x522E85: PyParser_ASTFromFileObject (pythonrun.c:1224)
==3810071==by 0x5231E9: PyRun_InteractiveOneObjectEx (pythonrun.c:238)
==3810071==by 0x5234D0: PyRun_InteractiveLoopFlags (pythonrun.c:120)
==3810071==by 0x523BF2: PyRun_AnyFileExFlags (pythonrun.c:78)
==3810071==by 0x4204FE: pymain_run_stdin (main.c:1185)
==3810071==by 0x42126B: pymain_run_python (main.c:1675)
==3810071==by 0x422EE0: pymain_main (main.c:1820)
==3810071==by 0x422F75: _Py_UnixMain (main.c:1857)
```

Reproduced on git commit hash 522346d792d9013140a3f4ad3534ac10f38d9085 .

--
components: Interpreter Core
messages: 335274
nosy: umanwizard
priority: normal
severity: normal
status: open
title: `growable_int_array type_ignores` in parsetok.c is not always freed.
type: resource usage
versions: Python 3.8

___
Python tracker 
<https://bugs.python.org/issue35973>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-02-11 Thread Brennan D Baraban


Brennan D Baraban <3...@holbertonschool.com> added the comment:

Well, Tuomas, I defer submission of a PR to you, as its your original patch.

--

___
Python tracker 
<https://bugs.python.org/issue23460>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-02-10 Thread Brennan D Baraban


Brennan D Baraban <3...@holbertonschool.com> added the comment:

What is the status of this issue? I can submit a PR based on Tuomas Suutari's 
patch.

--
nosy: +bdbaraban

___
Python tracker 
<https://bugs.python.org/issue23460>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35899] '_is_sunder' function in 'enum' module fails on empty string

2019-02-10 Thread Brennan D Baraban


Brennan D Baraban <3...@holbertonschool.com> added the comment:

Got it, makes sense. Thank you. New contributor here :)

--

___
Python tracker 
<https://bugs.python.org/issue35899>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35899] '_is_sunder' function in 'enum' module fails on empty string

2019-02-10 Thread Brennan


Brennan <3...@holbertonschool.com> added the comment:

I'm not sure if Maxwell is still working on this issue, but may I pick it up? I 
can submit a PR within the day.

--
nosy: +bdbaraban

___
Python tracker 
<https://bugs.python.org/issue35899>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28443] Logger methods never use kwargs

2016-10-14 Thread Jordan Brennan

Changes by Jordan Brennan <sc0...@googlemail.com>:


--
components: +Library (Lib)

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28443>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28443] Logger methods never use kwargs

2016-10-14 Thread Jordan Brennan

Changes by Jordan Brennan <sc0...@googlemail.com>:


--
components:  -Argument Clinic

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28443>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28443] Logger methods never use kwargs

2016-10-14 Thread Jordan Brennan

New submission from Jordan Brennan:

The methods on the Logger class e.g. logger.debug all accept **kwargs, these 
are passed to the _log method but they are never used.

If _log attached them as an attribute to the LogRecord object, it would allow 
for creation of more powerful Filter objects to be created.

You would then be able to filter log lines based on arbitrary keyword arguments.

I've attached a patch along with tests that I think would be a sensible 
addition and I think that this shouldn't impact existing users of the module.

--
components: Argument Clinic
files: loggingkwargs.patch
keywords: patch
messages: 278653
nosy: jb098, larry
priority: normal
severity: normal
status: open
title: Logger methods never use kwargs
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file45092/loggingkwargs.patch

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28443>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22028] Python 3.4.1 Installer ended prematurely (Windows msi)

2015-08-07 Thread Chris Brennan

Chris Brennan added the comment:

This bug appears (for me) when I use longer install paths, both in the GUI 
installer and doing a silent install via msiexec. The paths I've used so far 
are these:

E:\langs\Python\x32\27
E:\langs\Python\x32\34
E:\langs\Python\x64\27
E:\langs\Python\x64\34

E:\Python\x32\27
E:\Python\x32\34
E:\Python\x64\27
E:\Python\x64\34

Both of these paths fail to install when pip is called. If I install to a 
single-level directory, the install works fine (doesn't matter what drive I use 
either)

--
nosy: +Chris Brennan
versions: +Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22028
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Argument Presence Checking via Identity or Boolean Operation?

2015-06-04 Thread Russell Brennan
I'm going to x-post this to stackoverflow but...

When checking a method's arguments to see whether they were set, is it
pythonic to do an identity check:

def doThis(arg1, arg2=None):
  if arg2 is None:
arg2 = myClass()


Or is it proper form to use a short-circuiting boolean:

def doThis(arg1, arg2=None):
arg2 = arg2 or myClass()


In support of the former, PEP 8 states:

Comparisons to singletons like None should always be done with is or is not
, never the equality operators. Also, beware of writing if x when you
really mean if x is not None -- e.g. when testing whether a variable or
argument that defaults to None was set to some other value. The other value
might have a type (such as a container) that could be false in a boolean
context!


On the other hand, from the Google style guide:

Use the implicit false if at all possible. ...


But at the same time states...

Never use == or != to compare singletons like None. Use is or is not.


Does this apply to None since it evaluates to False always, and/or is a
boolean comparison equivalent to ==/!= under the hood?

Thanks much,
Russ
-- 
https://mail.python.org/mailman/listinfo/python-list


Simple ini Config parser examples needed

2008-12-02 Thread RON BRENNAN

Hello,
 
I have a very simple ini file that I needs parsed.  What is the best way I can 
parse an ini file that doesn't include sections?
 
As in:
 
person=tall
height=small
shoes=big
 
 
Thats it.  Can anyone help me?
 
Thanks,
Ron--
http://mail.python.org/mailman/listinfo/python-list


Multimapping and string converting

2008-09-19 Thread Ron Brennan
Hello,

I have a multimap dictionary with a 1 Key to N values.  I want to convert
the N values to a string to be used elsewhere in my program.

So I have dict[(1,[1, 2 ,3 ,4])] which I have sorted

When I do a print ''.join(str(dict.value())) I get [1, 2, 3, 4] as an output
when I really want 1 2 3 4

Here is my code:

dmapItems = dictionary.items()
dmapItems.sort()

for tcKey, tcValue in dmapItems:
file.write('Key = %s\nValue = %s % (tcKey, tcValue)

stinger = ''.join(str(tcValue))

print stringer

The Output = [145, 2345, 567, 898]
I need it to be 145 2345 567 898


Can anyone see the errors of my ways?

Thanks,
Ron
--
http://mail.python.org/mailman/listinfo/python-list

Configuration Parsers

2008-09-17 Thread Ron Brennan
Hello,

I am trying to parse a shared config file which doesn't contail section
headers.  Is there a way I can still use ConfigParser()?  If not what is a
widely used parser available?

Thanks,
Ron
--
http://mail.python.org/mailman/listinfo/python-list

Multipart - Counting the amount of Values for One key

2008-08-29 Thread Ron Brennan
hello,

I am trying to find the amount of values there are pertaining to one key.

For example:

- To find the average of the values pertaining to the key.
- Use the amount of values to calculate a histogram

Also, how do reference a specific value for a key in a multipart?

Thanks,
Ron



-- 
FYI, my email address is changing. My rogers account will be deactivated
shortly. From now on please use:
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list

Re: Multiple values for one key

2008-08-28 Thread Ron Brennan
I have another question.

How would like to be able to add the contents on the values for one key.

key['20001']:[978, 345]

How can I do this?

Thanks,
Ron

On Thu, Aug 28, 2008 at 11:56 AM, Bruno Desthuilliers
[EMAIL PROTECTED] wrote:

 norseman a écrit :

  Terry Reedy wrote:



 Ron Brennan wrote:

 Hello,
   How would I create a dictionary that contains multiple values for one
 key.


 Make the value a collection object (set or list if you plan to add and
 delete).

  I'd also like the key to be able to have duplicate entries.


 Dict keys must be hashable and unique.

 tjr

 --
 http://mail.python.org/mailman/listinfo/python-list

 
 First part I understand, second is still giving me a problem.

 For some reason I still want keys to be dbf column headers.
 like:

 name:address:zip so forth
  --- --- --
 guy: unknown:0
 girl: 123 tiny street:12345
 boy:321 here:3
 gal:999 over there: 5
 so forth

 Thus one key has many values. And you can then index on whatever key(s)
 you wish - name,zip...


 You can either use 1/ a list of dicts, or 2/ a dict mapping keys to lists.

 1/
 records = [
   {name:guy, address:unknown,zip:0},
   {name:girl, address:123 tiny street,zip:12345},
   {name:boy, address:321 here,zip:3},
   {name:gal, address:999 over there,zip:5},
 ]

 keys = (name, address, zip)

 print :.join(keys)
 print - * len(:.join(keys))
 for record in records:
data = [record[key] for key in keys]
print :.join(data)


 2/
 records = dict(
name=[guy, girl, boy, gal],
address=[unknown,123 tiny street,321 there,999 over there],
zip=[0, 12345, 3, 5]
)

 keys = (name, address, zip)
 nb_records = len(records[keys[0]])

 print :.join(keys)
 print - * len(:.join(keys))
 for i in xrange(nb_records):
data = [data[key][i] for key in keys]
print :.join(data)


 You are of course entitled the right to prefer the second solution, but
 then I hope I'll never have to maintain your code, since it's obviously not
 an appropriate data structure.

 With billions plus records,


 With billions plus records, it may be time to move to a serious RDBMS.
 Which btw will provide solution 1, or a lighter version of it using a list
 of tuples, ie:

 cursor = connection.cursor()
 cursor.execute(select name, address, zip from peoples)
 records = cursor.fetchall()

 # at this time, you have :
 #records = [
 #   (guy, unknown,0,),
 #   (girl, 123 tiny street,12345,),
 #   (boy, 321 here,3,),
 #   (gal, 999 over there, 5,),
 #]


 (snip)

 OK - I know I missed the whole concept of a Python Dictionary.


 Bad thing for you, since it's the central datastructure in Python.

 I haven't read anything as yet that gives a clear picture of what it is and
 what it is for.


 Then you failed to read the FineManual's tutorial, which is where you
 should have started:

 http://docs.python.org/tut/node7.html#SECTION00750

 Do yourself a favour : read the above first, then if you still have
 questions about dicts, we'll gladly try to help.

 And do yourself another favour : learn about SQL, relational model and
 RDBMS.

 (snip description of why the OP *really* wants a RDBMS)

 --
 http://mail.python.org/mailman/listinfo/python-list




-- 
FYI, my email address is changing. My rogers account will be deactivated
shortly.  From now on please use:
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list

Multiple values for one key

2008-08-27 Thread Ron Brennan
Hello,


How would I create a dictionary that contains multiple values for one key.
I'd also like the key to be able to have duplicate entries.

Thanks,
Ron

-- 
FYI, my email address is changing. My rogers account will be deactivated
shortly.  From now on please use:
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list

Sorting an array on the nth element in a list

2008-08-20 Thread Ron Brennan
Hello,

I am trying to parse a log file.  I want to sort based on the second element
the list that is in the file.

What is the best way to do this?  The sort is just on the line itself where
I want to re-organize the lines based on the second element of the csv file

Thanks,
Ron
--
http://mail.python.org/mailman/listinfo/python-list